Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Problem excecuting store thats return multiple result sets Expand / Collapse
Author
Message
Posted Tuesday, October 22, 2013 9:20 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, November 29, 2013 10:45 AM
Points: 2, Visits: 22
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
Post #1507214
Posted Wednesday, October 23, 2013 1:37 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, November 5, 2014 10:05 AM
Points: 1,549, Visits: 490
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...
Post #1507811
Posted Wednesday, October 23, 2013 2:10 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 9:00 AM
Points: 13,520, Visits: 11,313
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?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1507817
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse