Site icon Database Tutorials

@@SERVICENAME Function in SQL Server(TSQL)

 

You can find the name of the SQL Server Instance that you are connected to with the @@ SERVICENAME Function. If the instance you connected to is default instance, the result will return as MSSQLSERVER. If Named Instance, the result will return as Named Instance’s name.

When this function is executed on default instance:

When this function is executed on named instance:

Exit mobile version