@@SERVICENAME TSQL Tutorial

@@SERVICENAME function returns the instance name if the current instance is a named instance.

@@SERVICENAME Syntax

@@SERVICENAME;

@@SERVICENAME Example

SELECT @@SERVICENAME AS 'Instance Service Name';

Instance Service Name
MSSQLSERVER

See also:
T-SQL Functions -> @@SERVERNAME