Sep 4, 2003 #1 Jhankins Programmer Jun 17, 2003 46 AU i am using Query Analyzer and wish to join to another database. select c.x,c.y from db1.db.tble c join db2.db2.tble x on c.x = x.x where x.batch like 'me%' i am using SQL 2000 .. any help would be good
i am using Query Analyzer and wish to join to another database. select c.x,c.y from db1.db.tble c join db2.db2.tble x on c.x = x.x where x.batch like 'me%' i am using SQL 2000 .. any help would be good
Sep 4, 2003 #2 SonOfEmidec1100 Technical User Aug 12, 2001 965 AU Minor adjustments select c.x,c.y from db1..tble c INNER JOIN db2..tble x on c.x = x.x where x.batch like 'me%' Upvote 0 Downvote
Minor adjustments select c.x,c.y from db1..tble c INNER JOIN db2..tble x on c.x = x.x where x.batch like 'me%'
Sep 4, 2003 #3 SonOfEmidec1100 Technical User Aug 12, 2001 965 AU I should have added - This assumes they are on the same SQL Server instance. Upvote 0 Downvote
Sep 4, 2003 #4 JamesLean Programmer Dec 13, 2002 3,059 GB Slight clarification: To fully qualify an object name you can refer to it in the form: database.owner.object_name. So in your example you might use: db2.dbo.tble. However, if the owner is dbo then you can omit it, as in SonOfEmidec1100's answer. --James Upvote 0 Downvote
Slight clarification: To fully qualify an object name you can refer to it in the form: database.owner.object_name. So in your example you might use: db2.dbo.tble. However, if the owner is dbo then you can omit it, as in SonOfEmidec1100's answer. --James