I have following databases:
test
table1 fields: id, password, name, lastname
test2
table2 fields: id
How to select test
and test2
where table1
have id
in test2.table2.id
?
I have following databases:
test
table1
fields: id, password, name, lastname
test2
table2
fields: id
How to select test
and test2
where table1
have id
in test2.table2.id
?
Have you tried it? You just write the database name test2.dbo.tblFoo
, though you may need to declare an alias (just write a word after writing the actual name). And the account will obviously need permissions to both DBs.
SELECT /* stuff */
FROM table1 t1
JOIN table2 t2 ON t1.id = t2.id
I can use some functionality in ORM, Hibernate Shards for example.