Vishal
Vishal

Reputation: 1

How to use diffrent database's in one SSRS

I have two database and at first database have master table1 which have Id and name and another detail. and in second data base have a table2. In that table i save the id and another detail. And i need to show SSRS report.These report will show Table1's- Name and from Table2's Another detail related to Tabale1's Name .

Upvotes: 0

Views: 40

Answers (1)

Michael Harmon
Michael Harmon

Reputation: 746

Assuming the two databases are on the same server, you can use:

select fdt1.Name, fdt1.Detail as Detail1, fdt2.Detail as Detail2

from firstdatabase..table1 fdt1 join

seconddatabase..table2 fdt2

on fdt1.id=fdt2.id

If the databases are on different servers, you can create a linked server and use a four part naming convention to refer to the server the database is located on (as one option).

Upvotes: 2

Related Questions