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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Joining tables from two databases on the same serv

Author  Topic 

Billkamm
Posting Yak Master

124 Posts

Posted - 2006-01-11 : 16:11:58
Hi, I have multiple databases on one SQL Server and I need to be able to joing tables across these databases.

I once connected to a MySql database it was as simple as referring to the tables as database1.table1 and database2.table1 etc...

But that syntax isn't working for me with SQL Server. Can anyone help me?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-01-11 : 16:13:11
You need to use DatabaseName.ObjectOwner.ObjectName. ObjectOwner is typically dbo.

Tara Kizer
aka tduggan
Go to Top of Page

sanjay_jadam
Yak Posting Veteran

53 Posts

Posted - 2006-01-12 : 01:28:32
U what to get data by joining it?
If yes then try this
SELECT EmployeeID FROM Northwind..Employees NE INNER JOIN Pubs..Employee PE ON NE.FirstName = PE.fName
If no then can u give more explaination wht u want to do.
Go to Top of Page
   

- Advertisement -