Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a store procedure, which returns 4 different result sets.

when I create a dataset in SSRS, by default it fetches data only from the 1st record Set. I want to fetch the different result set from store procedure.

How can i define or set the result within the dataset..?

Example:-
create procedure TEST
AS

select 'Result_Set_1', name, type from sys.tables --- Result Set 1
select 'Result_Set_2', name, type from sys.procedures --- Result Set 2
select 'Result_Set_3', name, type from sys.objects --- Result Set 3
select 'Result_Set_4', name, type from sys.databases --- Result Set 4


Thx in Advace
Vinay
Posted
Updated 27-Jan-10 9:23am
v2

You can have multiple datasets as a datasource for SSRS.

Create 4 datasets and assign different resultset to each.
Now, use it as you need while designing.
 
Share this answer
 
If you are only returning 1 field (Or always the same number of fields)

You could try using UNION ALL

and that way you could have

SELECT aField FROM aTable WHERE aField = 'A Value'
UNION ALL
SELECT aField FROM aTable WHERE aField = 'Another Value'
UNION ALL
SELECT aField FROM aTable WHERE aField = 'You Guessed it, another value'


Try that?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900