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)
 Reterieving data from multiple server with one sql statement

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-08-15 : 07:38:18
Conrad writes "Hi there, just a quick question, I am currently in the process of creating a reporting page, for my teachers where they can insert their comments about students, but my problem is the information I need is stored in seperate servers,

Is it possible to write on SQL statement to would reterieve one output, but include data from both sources (databases).

Cheers in advance.

Conrad"

Thrasymachus
Constraint Violating Yak Guru

483 Posts

Posted - 2005-08-15 : 08:54:45
yes. you want to use linked server and ditributed queries. look up sp_addlinkedserver in SQL Server books online and then you can use tables from that server using the 4 part name like so...

SELECT col1
FROM ServerName.DatabaseName.Owner.TableName
WHERE...

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

Thank you, drive through
Go to Top of Page
   

- Advertisement -