Applies To: SQL Server 2014, SQL Server 2016 Preview
Returns the name of the registry key under which SQL Server is running. @@SERVICENAME returns 'MSSQLSERVER' if the current instance is the default instance; this function returns the instance name if the current instance is a named instance.
Applies to: SQL Server (SQL Server 2008 through current version).
SQL Server runs as a service named MSSQLServer.