Hi @Erik van de Burgwal ,
Whether you want to create table or database, you cannot use '-' directly to create it successfully, because '-' belongs to the operator and does not comply with rules for T-SQL identifiers.
The identifies that do not comply with these rules must be delimited by double quotation marks or brackets.
create database [u-test]
after the database has been created, the database name will not display double quotation marks or brackets, but when using the T-SQL, you need to add these symbols. Like this:
use [u-test]
An error will be reported when performing these steps as you have described:
An exception occurred while executing a Transact-SQL statement or batch.
------------------------------
ADDITIONAL INFORMATION:
Database 'u' does not exist. Make sure that the name is entered correctly. (Microsoft SQL Server, Error: 911)
The error shown in the additional information is the error that occurred when double quotation marks or brackets are not added. The UI does not recognize that the database used actually contains these symbols.
It is recommended not to use identifiers that do not comply with the rules, because it may cause more trouble in practice