Tuesday, February 14, 2012

Cross Database Join in a Data Source View

Hi,

Is it possible to do a cross database join in a report services data source view? It doesn't look like it.

If not I was thinking of linking the table into the other database.

TIA,
Darren

Hello Darren,

Yes, you can do joins to other databases.

For example:

select table1.col1

from db1.dbo.table1 t1

inner join db2.dbo.table2 t2 on t1.col1 = t2.col2

Jarret

|||In the interest of reuse I would like to reference two Data Source Views in the Model. I have a database that has static database for everyone and a separate database for every customer? Is that possible?|||If I add a related table from another database the model blows up when I autogenerate and says it can't find dbo.Table. It shouldn't be dbo.Table it should be database.dbo.Table. If I explore the data it works fine.

No comments:

Post a Comment