Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Els
Starting Member
2 Posts |
Posted - 2002-04-02 : 12:10:43
|
| Hello all,I need some input on this question:You want to reference two tables that reside in different databases on the same server. Example is: from the INVENTORY database you want to reference a table in the SALES database. How would I reference the table in the SALES database in a query. Many thanks |
|
|
yakoo
Constraint Violating Yak Guru
312 Posts |
Posted - 2002-04-02 : 12:16:39
|
| since the databases reside on the same server you can use a 3 part identifer to access the SALES databasethe syntax is database.owner_name.object_nameso you would want SALES.dbo.PURCHASESif they were on a completly different server you would have to do server.database.owner_name.object_nameTake a look in BOL under 'Using Identifiers as Object Names' for more details. |
 |
|
|
|
|
|