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.
Author |
Topic |
vanity
Starting Member
2 Posts |
Posted - 2006-08-01 : 11:01:33
|
Hi Guys, we are using sql server 2000 and we have a few servers. I need to pipe the resultset from a remote stored procedure (which ends with a select) result set into a temporary table.the remote querry does say:select 'hello world';and the way i'm trying to use it isinsert into #tempexec remotequerry;However this starts a infinite loop. (as in the querry doesnt end and it takes a long time to abort) How do i get functionality similar to this ? I have initiated the select that runs off the remote database inside a local stored procedure but that was 4x slower then getting it done remote side.Any suggestions ? CheersHassan |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-08-01 : 11:17:40
|
exec remotequerrys.b.exec linkedserver.database.dbo.remotequerryWhat happens if you execute it without the insert?If it's an infinite loop then the problem is with the SP not with your call.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
vanity
Starting Member
2 Posts |
Posted - 2006-08-01 : 11:22:34
|
remote procedure deffinition on db8 :CREATE PROCEDURE dbo.test ASselect 'hassan'GOremote procedure run from local servercreate table #temp(string varchar(20))insert into #tempexec db8.[ukplc web].dbo.test;drop table #tempI tried the remote procedure before the insert and it worked fine :D returned the atomic value 'hassan'Hope this clarifies any ambiguityCheersHassan |
 |
|
|
|
|