views:

1018

answers:

4

Is there any way to use a query and join two tables that is in two different database on the same server for DbVisualizer? I used the following for the SQL server

Select * from table union select * from datbase.dbo.table2

I tried this for the DbVisualizer, and it didnt work. How do I do this?

+2  A: 

If DBVisualizer supports views, manually setup a view of table2 in your database.

create view table2 as  select * from database.dbo.table2
Jamison
+6  A: 

If the databases are in different servers you need to make sure that they are set up as linked servers.

Also be warned that the optimizer is relatively weak in this scenario, same server or not. The problem is that the statistics used for weighting costs of different operations aren't necessarily meaningful between different databases, especially at the point where the two databases will "intersect". So performance isn't what it could be.

Joel Coehoorn
its the same server..... 2 different databases on the same server, you shouldn't have to set them up as linkedservers.
GordonB
A: 

I dont think it can be done. I resolved the situation, by running a nightly data transfer to the SQL server. I do the union select from there...

it's possible for sure - linked databases (experience/implementation is different from platform to platform)
Brian Dilley
A: 

You can use this query tool if you want to see a one time results of such query.

Itamar