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 Administration (2000)
 Linked Servers in the Same Server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-08-10 : 08:02:55
Ram writes "Hi All, I need to create a distributed query linking two databases. I understand the procedure to create a linker server and write query and execute it.
But, the problem I am facing is I do not have two servers in Development and Test environments, these two databases are deployed in the same server in test and development environment. Any ideas how I can write a distributed query even if the databases are in the same table(both these databases are sql server databases)."

Thrasymachus
Constraint Violating Yak Guru

483 Posts

Posted - 2005-08-10 : 11:32:30
you might want to take second read on your post to clearify because I think you have not gotten a response because it is a tad bit vague.

If you are trying to query 2 tables in 2 databases on the same instance of SQL, you can use the 3 part qualified name:

databasename.owner.tablename.

If you are trying to reference another table on another server where you have established a linked server use the 4 part qualified name.

linkedservername.databasename.owner.tablename

"pimpin' aint easy but someone has to do it."

====================================================
Regards,
Sean Roussy

Thank you, drive through
Go to Top of Page
   

- Advertisement -