How to reference a sql server with a backslash (\) in its name?

前端 未结 3 565
独厮守ぢ
独厮守ぢ 2021-02-13 04:33

Givens:

  • One SQL Server is named: DevServerA
  • Another is named: DevServerB\\2K5

Problem:

3条回答
  •  独厮守ぢ
    2021-02-13 05:28

    Try using square brackets:

    SELECT TOP 1 *  
    FROM [DevServerB\2K5].master.sys.tables
    

提交回复
热议问题