Error when creating database name using full of number in SQL Server 2008 R2 -


create database name using string, database create successfully.

example :

if db_id('database1') null create database database1 

command(s) completed successfully.

but create database name using full of number, having problem

example :

if db_id('1234567890') null create database 1234567890 

msg 102, level 15, state 1, line 1
incorrect syntax near '1234567890'.

is wrong in query?

try 1 -

if db_id('1234567890') null      create database [1234567890] 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -