I am trying to execute the following ad-hoc query (I have already configured the remote server to allow ad-hoc queries):
--EXECUTE AS USER = suser_name()
SELECT c.*
INTO #MyTempTable
FROM OPENROWSET('SQLNCLI', 'Server=MyRemoteServer;Trusted_Connection=yes;',
'select * from mydb..mytable (nolock)
where PurchaseOrderID in (''19509114'', ''24075854'')) AS c;
I receive the following error message: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
I have admin privileges on the remote box-how can I get this to execute in the context of my account rather than this NT AUTHORITY\ANONYMOUS LOGON account
Thanks,
-Dave