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

前端 未结 3 1836
说谎
说谎 2021-02-13 04:48

Givens:

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

Problem:

3条回答
  •  眼角桃花
    2021-02-13 05:12

    Try using square brackets:

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

提交回复
热议问题