Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 sp_addlinkedsrvlogin and impersonation?

Author  Topic 

duanecwilson
Constraint Violating Yak Guru

273 Posts

Posted - 2010-06-16 : 11:59:11
SQL Server instances
Server L = Localhost (fullll permissions)
Server S = Server using SQL Authentication (username, password) - some permissions including Alter Any Linked Server
Server W1 = Server 1 using Windows Authentication - view permissions
Server W2 = Server 2 using Windows Authentication - view permissions

* All queries from SSMS
* I have access to all 4 servers from SSMS simultaneously using different query tabs with the appropriate connections.
I created linked servers from L to all S, W1, and W2. W1 and W2 worked fine. With S, I had to add a linked server login with this script in SSMS:

Execute sp_addlinkedsrvlogin 'S'
, @useself = 'FALSE'
, @rmtuser= 'S'
, @rmtpassword='MyPassword'

It worked and the linked queries all worked.
Now, I created the linked servers on S (still running from SSMS on the L machine)
Now I get a login failed error on W1 and W2 when I run linked queries using W1 or W2, evidently because I am not using Windows authentication anymore. I am sure I have to run sp_addlinkedsrvlogin on S to 'impersonate' L (windows auth). Using the script above as a model, what what arguments would I use to impersonate L?

Duane
   

- Advertisement -