T-SQL Tutorial

T-SQL @@ServerName function


This function returns the name of the local server that is running SQL Server.

@@ServerName Syntax

@@SERVERNAME;

@@ServerName Example

SELECT @@SERVERNAME AS 'Local Server Name';

Local Server Name
TEST

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