June 24, 2013 at 10:08 am
I'm new to the forum so I hope this is the right place to ask this question.
I have a production and an archive database. I want to create a way to pull a combined report with data from both databases.
The databases are identical and on the same SQL instance.
I'm looking for the best solution to fit my needs.
Can I create a view that will pull from views already created in both databases?
Would SSAS or SSIS be more helpful in this?
Ultimately I need to be able to run a report that pulls information from both databases into a single report where it looks like it comes from one data source.
Thanks!
Clint
June 24, 2013 at 10:13 am
Trainacomin (6/24/2013)
I'm new to the forum so I hope this is the right place to ask this question.I have a production and an archive database. I want to create a way to pull a combined report with data from both databases.
The databases are identical and on the same SQL instance.
I'm looking for the best solution to fit my needs.
Can I create a view that will pull from views already created in both databases?
Would SSAS or SSIS be more helpful in this?
Ultimately I need to be able to run a report that pulls information from both databases into a single report where it looks like it comes from one data source.
Thanks!
Clint
if they are on the same server, you can just use three part naming conventions.
if they are on separate servers, you can add a linked server, and use full four part names.
SELECT T1.*,T2.*
FROM PRODUCTION.dbo.MyTable T1
INNER JOIN Archive.dbo.OtherTable T2
On T1.Keys = T2.Keys
Lowell
June 24, 2013 at 1:25 pm
This works thanks!
Since both databases are identical is there any way I can filter on a field and it search both databases? Or do I have to do it in separate select queries?
I'd like to use this in SSRS but only have one filter to use for the report.
June 24, 2013 at 2:37 pm
I should clarify, both database have the same tables and columns. The data is different as one is an archive database.
June 24, 2013 at 2:46 pm
Hi
You can use UNION operation to combine the results from two queries into single result set.
Regards
Mike
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply