SQL @@servicename is SQL Server configuration function which returns the name of the registry key under which SQL Server is running.
This function does not require any argument, you can simply use it in a select statement to return the registry key’s name.
It returns ‘MSSQLSERVER’ if the current instance is the default instance.
Lets look at an example of SQL Server @@servicename.
Following SQL Statement uses @@servicename function which returns the name of SQL Server service which is currently running.
SELECT @@SERVICENAME AS [Service Name]
You can also read following SQL Configuration function.
303 total views, 1 views today