Showing posts with label dash. Show all posts
Showing posts with label dash. Show all posts

Thursday, March 8, 2012

Creating a linked server to a server with a dash in the name...

I need to create a linked server to a SQL 2005 server (B) from another SQL 2005 server (A). Problem is that Server B's name has a dash in it, and SQL Server doesn't like dashes in the name when running a query against the linked server. Server B's network name is Server-B. For example, from Mgt Studio on Server A, I've created a link to Server B whose name is Server-B, so in my query from Server A, I issue: SELECT * FROM Server-B, and get the following error message:

Msg 102, Level 15, State 1, Line 1

Incorrect syntax near '-'.

Any ideas,

Thnx

Roz

Try

SELECT * FROM [Server-B].....

HTH!

|||

This worked perfectly. So simple.

Thnx

Roz