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)
 query multiple databases

Author  Topic 

tpiazza55
Posting Yak Master

162 Posts

Posted - 2008-01-15 : 15:23:12
how do i query multiple databases that are on different servers?

also the server name has dashes in it

trying

select *
from [server-1-db].databasename.dbo.tablename

get an error about incorrect syntax near "-"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-01-16 : 02:28:07

Did you add server-1-db as linkded Server?

Madhivanan

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

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2008-01-16 : 05:35:14
As already suggested , use Linked Servers, make sure you've got the right permissions. The dashes should not be an issue if you have []

Jack Vamvas
--------------------
Search IT jobs from multiple sources- http://www.ITjobfeed.com
Go to Top of Page

tpiazza55
Posting Yak Master

162 Posts

Posted - 2008-01-16 : 09:30:12
linked server had the wrong password

thanks for your help
Go to Top of Page
   

- Advertisement -