@@REMSERVER with linked servers

From: Peter Hyssett (peter@hyssett.fsnet.co.uk)
Date: 09/25/02


From: "Peter Hyssett" <peter@hyssett.fsnet.co.uk>
Date: Wed, 25 Sep 2002 04:55:42 -0700


Hi.
My system has multiple databases spread over multiple
linked servers. There is a requirement for a Stored
Procedure to call another Stored Procedure in another
database, which may or may not be on the same server. For
security I check @@NESTLEVEL, which is > 1 if the two SPs
are on the same server but = 1 if on linked servers.
According to BOL, @@REMSERVER would be non-null if the
call was from a remote server, but from a linked server it
comes up as NULL.
    Is there an equivalent of @@REMSERVER (or some other
mechanism) which would identify the calling server when a
SP is called from a linked server?
   Thanks in advance,
Peter.



Relevant Pages

  • Executing a stored procedure that uses linked server from vb.NET
    ... The stored procedure takes the 3 arguments and uses joins to 2 other ... I can run the stored proc on in QA on my MS SQL with no prob. ... Must i open connections to the 2 linked servers from .NET as well? ...
    (microsoft.public.dotnet.languages.vb)
  • command timeout does not work
    ... The 2nd Stored Procedure returns a Record, while the 1st is not selecting ... linked servers. ... The ADO query does not run in Transaction nor does any transaction opened in ... SET NOCOUNT ON is set in both Stored procedures. ...
    (microsoft.public.data.ado)