@@REMSERVER (T-SQL)

Returns the name of the remote Microsoft® SQL Server™ database server as it appears in the login record.

Syntax

@@REMSERVER

Return Types

nvarchar(128)

Remarks

@@REMSERVER enables a stored procedure to check the name of the database server from which the procedure is run.

Examples

This example creates a procedure, check_server, that returns the name of the remote server.

CREATE PROCEDURE check_server

AS

SELECT @@REMSERVER

  

The stored procedure is created on SEATTLE1, the local server. The user logs on to a remote server, LONDON2, and runs check_server.

exec SEATTLE1...check_server

  

Here is the result set:

---------------

LONDON2

  

See Also
Configuring Remote Servers Configuration Functions

  


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