can I give SQL Server database name with hyphen like abc-123?

后端 未结 4 1431
清歌不尽
清歌不尽 2021-01-17 10:31

I created a sql server database with name of abc-123, in that I created a table Emp, when I run like

select * from abc-123.emp;
I am gett
4条回答
  •  伪装坚强ぢ
    2021-01-17 10:35

    Use Back Quote for the DB name

    select * from `abc-123`.emp;
    

    or, select the existing database with a USE statement and run the query.

    USE `abc-123`;
    select * from emp;
    

提交回复
热议问题