Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyphen in server name causes incorrect syntax error

Status
Not open for further replies.

MELc

Programmer
Joined
Aug 14, 2002
Messages
7
Location
US
The SQL query below fails with incorrect syntax error. Is there a workaround without changing the server name? The server is a linked server.

SELECT * FROM server-1.msdb.dbo.backupset

Your help is appreciated.
 
try SELECT * FROM [server-1].msdb.dbo.backupset
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top