January 13, 2004 at 6:01 am
Hallo friends
I am using the following method to insert the result of stored procedure into a table
insert into <table name)
exec <stored procedure>
This is functioning without any problem. If the results are comming from a linked server, inserting is not working. The linked server is using inside the stored procedure.
Any ideas
Joseph
January 13, 2004 at 6:16 am
So, what kind of error do you get?
Can you exec without the insert?
Are you using the correct syntax?
exec server.dbname.owner.procname
I assume here that you are trying to do something like; INSERT mytable EXEC remoteserverProcedure.
Is that correct?
=;o)
/Kenneth
January 13, 2004 at 6:26 am
Procedure give results without insert within 1 sec.
But when I use this procedure with insert is not working.
there is no error messages. I have waited more than 30 minutes. and nothing happend.
Joseph
January 13, 2004 at 6:34 am
Can you provide your exact syntax for both attempts?
Both when it succeeds and when it fails.
If it fails.. You say you wait - Does the query come back or is it still running after 30 minutes?
If the latter, then check for blocking on the remote server.
=;o)
/Kenneth
January 13, 2004 at 6:43 am
storedprocedure
Create procedure test_insert
as select title_id from mylinedserver.pubs.dbo.titles
exec test_insert is working
but
create table #tmp
(title_id varchar(15))
insert into #tmp
exec test_insert is not working
January 13, 2004 at 8:44 am
And you are still positive that you recieve no messages at all?
I must ask you if the query completes at all? If it does then you should recieve something in return.
Have you tried it with a permanent table instead? Or try to specify the column name in the insert.
Have no linked server I can try it on for the moment, sorry.
=;o)
/Kenneth
January 14, 2004 at 10:48 am
Try setting SET NOCOUNT OFF in the stored procedure. I have had sp's return nothing because I did not set nocount to off.
April 1, 2005 at 3:35 pm
This will only work with OPENQUERY. I spent a lot of time on it. Use OPENQUERY to get the results from your remote server
Hope that helps....
April 1, 2005 at 3:45 pm
This thread is 14 months old ... chances are they have the answer by now
April 3, 2005 at 12:03 am
Better late than never... It was the answer I was looking for...
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply