Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Reporting Services DataSet

Author  Topic 

dewacorp.alliances

452 Posts

Posted - 2008-05-05 : 22:20:00
Hi there

I am trying to figure out whether it is a possible or not to have a stored procedure that can return 2 dataset what I mean returning 2 selects and then manipulated within RS? If it's possible, can someone show me how?

The reason I am asking this due to have 2 return table view if you like that I manipulated each one of them differently and I rather do it one process instead of calling the same query for different view.

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-06 : 11:30:09
quote:
Originally posted by dewacorp.alliances

Hi there

I am trying to figure out whether it is a possible or not to have a stored procedure that can return 2 dataset what I mean returning 2 selects and then manipulated within RS? If it's possible, can someone show me how?

The reason I am asking this due to have 2 return table view if you like that I manipulated each one of them differently and I rather do it one process instead of calling the same query for different view.

Thanks


You can do this using a union all


select fields....,'1stquery' as category
from.....
..

union all

select fields,...,'2nd query'
from...
....


and in report you can filter on category field value to get data for two tables


Go to Top of Page

dewacorp.alliances

452 Posts

Posted - 2008-05-06 : 16:14:45
quote:

You can do this using a union all

select fields....,'1stquery' as category
from.....
..

union all

select fields,...,'2nd query'
from...
....

and in report you can filter on category field value to get data for two tables



Hi Visakh16

Does this means I work on the same TABLE/LIST/MATRIX in RS? Or I can create another instance of it? But isn't that doubling the query if I do that?

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-07 : 02:39:11
quote:
Originally posted by dewacorp.alliances

quote:

You can do this using a union all

select fields....,'1stquery' as category
from.....
..

union all

select fields,...,'2nd query'
from...
....

and in report you can filter on category field value to get data for two tables



Hi Visakh16

Does this means I work on the same TABLE/LIST/MATRIX in RS? Or I can create another instance of it? But isn't that doubling the query if I do that?




Yup it will return as a single dataset which you can use in single TABLE/MATRIX and use the category field to distinguish b/w the two resultsets with same dataset
Go to Top of Page

dewacorp.alliances

452 Posts

Posted - 2008-05-07 : 04:48:27
quote:

Yup it will return as a single dataset which you can use in single TABLE/MATRIX and use the category field to distinguish b/w the two resultsets with same dataset



Actually ... I've just played around with this and you are right ... you can have a single dataset and use filter as apart of TABLE/MATRIX/LIST and you can display the view that you want. This is brilliant!!!

Thanks.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-05-07 : 10:58:50
quote:
Originally posted by dewacorp.alliances

quote:

Yup it will return as a single dataset which you can use in single TABLE/MATRIX and use the category field to distinguish b/w the two resultsets with same dataset



Actually ... I've just played around with this and you are right ... you can have a single dataset and use filter as apart of TABLE/MATRIX/LIST and you can display the view that you want. This is brilliant!!!

Thanks.


You're welcome
Go to Top of Page
   

- Advertisement -