permission test.(impersonate)

select SUSER_ID(), SUSER_NAME() go select * from server_A.master.dbo.sysobjects go

(1 row(s) affected) Msg 18452, Level 14, State 1, Line 0 Login failed for user ‘(null)’. Reason: Not associated with a trusted SQL Server connection.

execute as login = ‘sql_admin’ –who has the permission to login the server. go select SUSER_ID(), SUSER_NAME() go select * from server_A.master.dbo.sysobjects go

(1 row(s) affected)

(1277 row(s) affected)

revert; go select SUSER_ID(), SUSER_NAME() go