@@SERVERNAME (T-SQL)

Returns the name of the local server running Microsoft® SQL Server™.

Syntax

@@SERVERNAME

Return Types

nvarchar

Remarks

The Setup program sets the server name to the computer name during installation. You can change @@SERVERNAME by using sp_addserver and then restarting SQL Server; although this method is not usually required.

Examples

SELECT @@SERVERNAME

  

See Also
sp_addserver Configuration Functions

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.