SQL @@SERVICENAME is one of the Configuration Function, used to return the registry key under which SQL Server is currently running. If it is a default instance then it will write MSSQLSERVER as the service name, and if it is a named instance then it will return instance name. Syntax behind this is
SQL @@SERVICENAME Example
Below code snippet will show you the SQL Server service name that we are currently running.
SELECT @@SERVICENAME AS 'Service Name'
Thank You for Visiting Our Blog