May 8, 2006 #1 SteveMe MIS Aug 30, 2002 83 US Exec checkk 'enrgy80' Exec checkk 'enrgy46' I need the records from this stored procedure into one dataset via a select statement
Exec checkk 'enrgy80' Exec checkk 'enrgy46' I need the records from this stored procedure into one dataset via a select statement
May 8, 2006 #2 jbenson001 Programmer Jan 7, 2004 8,172 US How do you want to call the SP, in QA, or from a front end app? Jim Upvote 0 Downvote
May 9, 2006 #4 gmmastros Programmer Feb 15, 2005 14,910 US You should create a temp table that has the same structure as the data returned from the stored procedure, then Insert exec from the stored procedure. Create Table #Temp(Field1 DataType1, Field2 DataType2) Insert Into #Temp Exec Checkk 'enrgy80' Insert Into #Temp Exec Checkk 'enrgy46' Select * from #Temp The syntax may not be perfect, but the process is the way to go. Check Books on line for more information. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlpro2k/html/sql00g7.asp -George Strong and bitter words indicate a weak cause. - Fortune cookie wisdom Upvote 0 Downvote
You should create a temp table that has the same structure as the data returned from the stored procedure, then Insert exec from the stored procedure. Create Table #Temp(Field1 DataType1, Field2 DataType2) Insert Into #Temp Exec Checkk 'enrgy80' Insert Into #Temp Exec Checkk 'enrgy46' Select * from #Temp The syntax may not be perfect, but the process is the way to go. Check Books on line for more information. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlpro2k/html/sql00g7.asp -George Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
May 9, 2006 Thread starter #5 SteveMe MIS Aug 30, 2002 83 US gmmastros I get an error when trying that Server: Msg 8164, Level 16, State 1, Procedure Checkk , Line 29 An INSERT EXEC statement cannot be nested. (0 row(s) affected) Upvote 0 Downvote
gmmastros I get an error when trying that Server: Msg 8164, Level 16, State 1, Procedure Checkk , Line 29 An INSERT EXEC statement cannot be nested. (0 row(s) affected)
May 9, 2006 #6 SQLDenis Programmer Oct 1, 2005 5,575 US Did you put this code Insert Into #Temp Exec Checkk 'enrgy80' Insert Into #Temp Exec Checkk 'enrgy46' into the Checkk proc? This will create an infinite loop You have to put it into a seperate proc Denis The SQL Menace SQL blog:http://sqlservercode.blogspot.com/ Personal Blog:http://otherthingsnow.blogspot.com/ Upvote 0 Downvote
Did you put this code Insert Into #Temp Exec Checkk 'enrgy80' Insert Into #Temp Exec Checkk 'enrgy46' into the Checkk proc? This will create an infinite loop You have to put it into a seperate proc Denis The SQL Menace SQL blog:http://sqlservercode.blogspot.com/ Personal Blog:http://otherthingsnow.blogspot.com/