Create a database name using string, database will create successfully.
Example :
if db_id('Database1') is null create database Database1
Command(s) completed successfully.
But create database name using full of number, it having a problem
Example :
if db_id('1234567890') is null create database 1234567890
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '1234567890'.
Is anything wrong in my query?
Try this one -
IF DB_ID('1234567890') IS NULL
CREATE DATABASE [1234567890]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With