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.
Author |
Topic |
dewacorp.alliances
452 Posts |
Posted - 2008-05-05 : 22:20:00
|
Hi thereI 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 thereI 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 allselect fields....,'1stquery' as categoryfrom.......union allselect fields,...,'2nd query'from.......and in report you can filter on category field value to get data for two tables |
 |
|
dewacorp.alliances
452 Posts |
Posted - 2008-05-06 : 16:14:45
|
quote: You can do this using a union allselect fields....,'1stquery' as categoryfrom.......union allselect fields,...,'2nd query'from.......and in report you can filter on category field value to get data for two tables
Hi Visakh16Does 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? |
 |
|
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 allselect fields....,'1stquery' as categoryfrom.......union allselect fields,...,'2nd query'from.......and in report you can filter on category field value to get data for two tables
Hi Visakh16Does 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 |
 |
|
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. |
 |
|
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 |
 |
|
|
|
|
|
|