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


SSRS report with multiple datasets


SSRS report with multiple datasets

Author
Message
sql_novice_2007
sql_novice_2007
SSChasing Mays
SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)

Group: General Forum Members
Points: 652 Visits: 726
I need to create one report with 5 different data sets and from 5 diff data sources. All the 5 data sources are from 5 diff servers and they are not linked servers. So I am creating 5 data sets with 5 diff data sources and executing 5 diff stored procedures and getting 5 diff result sets with same column names and need to add all these 5 result sets into one report.
I need to union the result set of all the 5 Stored procs and use it one report.

How can I do this?

Thanks.
pietlinden
pietlinden
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13760 Visits: 14118
You can't create linked servers and do the union in your stored procedure?
sql_novice_2007
sql_novice_2007
SSChasing Mays
SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)SSChasing Mays (652 reputation)

Group: General Forum Members
Points: 652 Visits: 726
No. I can't create linked server.
stephen.lawrenson
stephen.lawrenson
SSC-Enthusiastic
SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)

Group: General Forum Members
Points: 167 Visits: 294
Perhaps this might help

http://technet.microsoft.com/en-us/library/ms188386.aspx

if it can be near time, could you also not configure a SSIS package to consolidate the data into one location?
chris.stuart
chris.stuart
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1168 Visits: 808
Well if all else fails and you don't need to combine the data and sort it, why not create 5 tables and make sure that the tables positioning on the report leave no spaces between the tables, It will look like 1 table but not function as 1 table
samuel.jones
samuel.jones
SSC Rookie
SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)SSC Rookie (39 reputation)

Group: General Forum Members
Points: 39 Visits: 77
one way to do it could be to have a master report with 5 subreports each pulling a resultset. If you need to manipulate the resultset I don't know if that single report will allow for it though. Another possibility (that might be overkill) is to create a library in .NET that sets up those connection strings and pulls the results into a single resultset then returns the result to the report.

In either case, you might want to re-examine the workflow that makes this necessary. It might be legitimate, but it sure feels wrong...
John Jakob
John Jakob
SSC Veteran
SSC Veteran (240 reputation)SSC Veteran (240 reputation)SSC Veteran (240 reputation)SSC Veteran (240 reputation)SSC Veteran (240 reputation)SSC Veteran (240 reputation)SSC Veteran (240 reputation)SSC Veteran (240 reputation)

Group: General Forum Members
Points: 240 Visits: 8
Like one of the other poster says, try using a stored proc.

You can use the OPENROWSET approach to create (in-effect) an on-the-fly linked server for each server connection.
And then UNION all the individual queries together. This sample works for me -- using just 2 servers. Could easily extend it to five.

-- List the databases on several different servers
SELECT A.*
FROM OPENROWSET('SQLOLEDB', 'SERVERA' ; 'sa' ; 'SAPasswordA',
'SELECT * FROM master.dbo.sysdatabases') as A

UNION

SELECT B.*
FROM OPENROWSET('SQLOLEDB', 'SERVERB' ; 'sa' ; 'SAPasswordB',
'SELECT * FROM master.dbo.sysdatabases') as B


A couple of notes here:
1. You may not want to use the "SA" -- and even if you do, you probably should not hard-code the SA passwords in your proc [Bad practice]!
2. You may want to retrieve just the columns you want, and not do the "SELECT *".

-john



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