You can have "linked servers", which will treat multiple physical (or logical) database servers as one machine. When you get to building your query, though, you will have to reference cross-database queries like this:
Code:
SELECT
p.name,
a.address
FROM
human_resources.dbo.person AS p
INNER JOIN mailing_room.dbo.address AS a
ON p.ssn = a.ssn
In this query, the name "human_resources" or "mailing_room" would represent your database (aka catalog) name. The "dbo" would represent the object owner (the user role in the database who owns the object. "dbo" is default. You can also leave it blank for dbo - i.e. "human_resources..person"). The "person" or "address" would represent the name of the table. "p" and "a" are aliases to the tables, and so on.
This assumes that all of your databases (catalogs) are on one server or multiple linked servers.
Last edited by smoseley; April 14 '03 at 05:14 PM.
|