views:

83

answers:

2

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
+1  A: 

Also visit this thread for further clarification: http://stackoverflow.com/questions/153861/brackets-in-sql-statements

Raze2dust