@@SERVERNAME

variables
#tsql#variables

Returns the name of the SQL Server instance the client is connected to.

Syntax

@@SERVERNAME

Return Type

nvarchar(128)

Remarks

Example

SELECT @@SERVERNAME AS [Server Name];