Linked server question

  • Hello,

    We have a servername with '-' in it. For Ex. 'My-server'

    I added this server as a linked server on another server which is server2. Now when I query in QA from server 2..

    select * from my-server.mydb.dbo.table1 It comes with a message

    Line 1: Incorrect syntax near '-'. or Incorrect Syntax near my-server.

    Not sure what I can do here. Did anyone had this problem or have solution for it?

    I think tweaking some settings in QA might help it, but I am not sure- I tried everything.

    Thanks for your help.

    -Hiren

     

     

  • Use [] to querify your server in your select statement.

    select * from [my-server].mydb.dbo.table1

     

  • That will do. Thanks, Allen.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply