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 2000 Forums
 SQL Server Development (2000)
 OPENROWSET

Author  Topic 

KabirPatel
Yak Posting Veteran

54 Posts

Posted - 2007-04-10 : 09:48:41

Hi,

I am trying to execute a stored procedure that invokes data from a table in a remote server.

To do this I run the following:
INSERT INTO MYTABLE
SELECT
A.MyData
,getdate()
,user
FROM
OPENROWSET('SQLOLEDB', 'RemoteServer'; 'username'; 'password',
'SELECT MyData FROM RemoteDatabase.dbo.RemoteTable') as A

This works fine and as expected.

I created a stored procedure with exactly the same code. When I try to run it in query analyser, the process just hangs and doesnt do anything.

Do any of you know why this would work using SQL in query analyser but not as a stored procedure?

Thanks
Kabir
   

- Advertisement -