SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Problem excecuting store thats return multiple result sets


Problem excecuting store thats return multiple result sets

Author
Message
artud2
artud2
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 23
hello sorry i have post the last time empty by error but now this is my issue

i have a store procedure that return multiple datasets i want to manipulate one of theses datasets to input in a datatable is this posible and how


plese help me
Chris Hurlbut
Chris Hurlbut
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1848 Visits: 540
Well I had to put results from an SP into a table and here is how I did it:

DECLARE @RC int

INSERT INTO [Database].[dbo].Table_to_Insert_Into ( SP_Column1 , SP_Column2)

EXECUTE @RC = [Database].[dbo].[Sp_to_Run]
@Parameter

This is assuming the stored procedure returns two columns (1 or more rows) and Passing a parameter.

Hope this helps...
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27135 Visits: 13268
Since you mention datatable, I assume you're using .NET?
Take a look at MARS (multiple active result sets):

Manipulating Data
http://stackoverflow.com/questions/6043685/can-we-return-a-multiple-result-set-in-stored-procedure-and-how-to-handle-it-in


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search