Incorrect syntax around '-'

I am trying to run a request on another server and should specify it in the select statement, but the server name has a '-' in it, for example the server name. this leads to an error in the header. How can i fix this?

+3
source share
1 answer

Use square brackets []around the server name:

select  * 
from    [server-name].[db-name].[schema-name].[table-name]
+17
source

Source: https://habr.com/ru/post/1752801/


All Articles