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
 SQL Server Development (2000)
 my question

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-01-11 : 08:43:10
padma writes "I have 2 databases .I created one grid report in VB.The report i created has the fields of a database named bilzdb.But I want to add the field of a table which is in another data base named bilzdb2 to that report.What is the query forthat
sorry i made one mistake in previous question"

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2005-01-11 : 11:53:29
After setting up a connection to both databases (See Linked Servers in BOL), you can use the four part naming to reference the "other" table:

Ex.

select t1.Stuff, t2.Column
from ThisTable t1
join ThatServer.ThatData.ThatOwner.ThatTable t2
on t1.ThisKey = t2.ThatKey
where blah, blah, blah

HTH

=================================================================

Scriptures, n. The sacred books of our holy religion, as distinguished from the false and profane writings on which all other faiths are based.
-Ambrose Bierce, writer (1842-1914) [The Devil's Dictionary]
Go to Top of Page
   

- Advertisement -