i am trying to run a query in another server and need to specify it in the select statement but the server name has got an '-' in it, like server-name. this is producing the error in the title. How can i fix it?
+12
A:
Use square brackets []
around the servername:
select *
from [server-name].[db-name].[schema-name].[table-name]
Andomar
2010-07-02 10:24:15
+1
A:
Also visit this thread for further clarification: http://stackoverflow.com/questions/153861/brackets-in-sql-statements
Raze2dust
2010-07-02 10:54:54