Question

I am trying to find a way of linking data from two servers in SSRS report builder 2.0

ultimately using one dataset to query 2 databases in 2 different servers.

The SQL that i have is very basic as shown below and i can run the query easily in SQL management studio.

select * from
[server1].[DES].[dbo].[Daily] dr 
LEFT JOIN [server2].[VES].[dbo].[Rou] mr
ON dr.ID = mr.id

Also the access i have to the reporting server is read only so i cant really make any administrative changes to the configuration.

I have explored the connection string to create a connection but it only allows me to connect to one server for each dataset. what i am trying to do is use one dataset

Any help will be greatly appreciated as i am a junior in SQL and SSRS

Using SSRS and MS SQL 2008 R2

Was it helpful?

Solution

if you executing this query from your SSMS it means this other server is a linked server. then it should be no different to execute it from SSRS.

Yes it is right you can only add one server to your data source of your dataset whether its a shared data source or embedded.

But for instance if you have a data source pointing to say Server A when you executing queries which will be pulling data from Server A and also from server B you will Use fully Qualified name for the Objects from server B and two part name from server A.

something like this ...

SELECT * 
FROM Schema.Table_Name A INNER JOIN [ServerNameB].DataBase.Schema.TableName B
ON A.ColumnA = B.ColumnA

obviously ServerB has to be a Linked Server.

OTHER TIPS

I can think of two possible solutions

Option 1: Creating a stored procedure on server1 (With a query accessing the another server). And call this stored procedure from SSRS (Dataset).

Option 2: Create two dataset with two different connection strings on the RDL (one for Server1 and another for Server2). Use the "LookUpDataSet" function in Report Builder to merge the results using the key fields.

Option 2 is preferable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top