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
 Transact-SQL (2000)
 Stupid question but im tired sorry

Author  Topic 

stumbling
Posting Yak Master

104 Posts

Posted - 2009-09-24 : 17:55:14
Hi All

for the life of me i can not remember how to define a comp name in a statement when the comp name is like

WTH-123-456

Select * FROM WTH-123-456.Database.dbo.Table

Any help would be great.

Cheers

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-09-24 : 18:00:27
If by "comp name" you mean "computer name", and if by "computer name" you mean "linked server name", then just add square brackets:

Select * FROM [WTH-123-456].Database.dbo.Table

As long as you've registered that server as a linked server beforehand, you can query it that way.
Go to Top of Page

stumbling
Posting Yak Master

104 Posts

Posted - 2009-09-29 : 00:44:51
Thanks for that.
Cheers
Go to Top of Page
   

- Advertisement -