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 2005 Forums
 Transact-SQL (2005)
 Linked Server with a -

Author  Topic 

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2008-02-06 : 15:05:44
I have the following name of a linked server
MI-TR-IMCMACG01, the connection tests just fine, but when I got to select from it:


select top 10 * from MI-TR-IMCMACG01.IMCMFTP.dbo.SECUMST2

I get:

Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '-'.

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2008-02-06 : 15:36:47
quote:
Originally posted by duhaas

I have the following name of a linked server
MI-TR-IMCMACG01, the connection tests just fine, but when I got to select from it:


select top 10 * from MI-TR-IMCMACG01.IMCMFTP.dbo.SECUMST2

I get:

Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near '-'.





try this:

select top 10 * from [MI-TR-IMCMACG01].IMCMFTP.dbo.SECUMST2




-ec
Go to Top of Page

duhaas
Constraint Violating Yak Guru

310 Posts

Posted - 2008-02-06 : 15:42:55
perfect, i could of sworn i tried that, but it worked. thanks much
Go to Top of Page
   

- Advertisement -