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

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-01-13 : 08:46:11
Ramesh writes "Hai,
i want to connect to a database say db2 which is in other machine say machine2.

i want to query the tables from my database of other database(say db2)

Both are sql server database

Could some one help me

Thanks in advance

Bye"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-01-13 : 09:11:29
Look for sp_addlinkedserver in BOL, SQL Server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-01-13 : 10:11:00
Once you've made your Linked Server, as Madhi suggests, you can then just do:

SELECT *
FROM machine2.db2.dbo.RemoteTableName

Kristen
Go to Top of Page
   

- Advertisement -