views:

107

answers:

1

I want to compare records between 2 databases on my SQL 2008 Server. The query below works in SSMS.

SELECT 'Manual',
       manual.*,
       'Auto',
       Auto.*
  FROM    (SELECT * FROM TESTINGSOMODS..TESTINGSOManMODS) Manual
       FULL OUTER JOIN
          (SELECT * FROM CHELTONCUSTOMIZATIONS..SOMODS) Auto
       ON manual.[Order No] = auto.fsono

I created a solution and when I tried to set up a shared data source, I am confronted with the following:

DataSource

So, my first question is, if I want to pull from 2 different databases what do I enter for "Select or enter a database name"?

+2  A: 

Set it up to run from TESTINGSOMODS. Create a stored procedure on TESTINGSOMODS that contains the query, use this procedure for the report. The report will not know that you are accessing CHELTONCUSTOMIZATIONS, it will only look at a result set from the procedure on TESTINGSOMODS.

KM
Please have patience as I'm new to SSRS, though I have taken a class on it. Is there no way to simply enter my SQL statement to skip creation of the datasource? What if I'm working with databases that I am not allowed to alter by the use of SP's? How would I accomplish this in that case?
DavidStein
if you can't add a stored procedure you best bet is to try using a fully qualified name, select one database as the source, then refer to each table using a complete 4 part name like: `server.database.schema.table`
KM

related questions