dgolds


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




Re: OPENROWSET Error

Jens K. Suessmeyer


Hi,

being logged in with a SQL Server account wont¡¯make it possible for SQL Server to impersonate you at the other end. Do you use WIndows Authentication on your query issuing connection (i guess not)

HTH, Jens K. Suessmeyer.

---
http://www.sqlserver2005.de
---





Re: OPENROWSET Error

dgolds

Actually, I am using Windows Authentication. None of our servers are configured to even allow mixed or SQL Authentication.

Thanks,

-Dave