Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Queries accross multiple DBs on the same server

Status
Not open for further replies.

whool

Programmer
Jan 31, 2002
31
AU
I want to create a select query that joins two tables from two differnent Databases residing on the same instance of instance of SQL Server 2000.

Is there any way of doing this other than setting up one of the Dbs as a linked server?

Yael
 
Use the three part table name - database.owner.table.

Select a.col1, a.col2, b.col3, b.col4
From ab1.dbo.tableA a
Join db2.dbo.tableB b
On a.col1=b.col1

Note: You can't set up a database as a linked server. You can add a server as a linked server.
Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top