Home All Groups Group Topic Archive Search About
Author
9 Dec 2005 1:55 PM
Nancy Lytle
I am doing some testing on a database created by the programming dept of the
company, they named the database '123v10'.
When I run some queries (mostly admin stuff, checking the fragmentation,
space used by the data and log files, etc) in the Query Analyzer, I often
get the error message:
Line 1: Incorrect syntax near '123'.

My guess is that SQL doesn't particularly like database names that start
with numbers, am I correct?  If so, will this create any real problems down
the line?  I think we are at an early enough stage that the database could
be renamed if this would help.

TIA,
Nancy L

Author
12 Dec 2005 1:37 PM
Mike Epprecht (SQL MVP)
Hi

According to the rules for regular identifiers (from the SQL Server 2005
BOL), a number can not be used as a valid first character:

The first character must be one of the following:

    A letter as defined by the Unicode Standard 3.2. The Unicode definition
of letters includes Latin characters from a through z, from A through Z, and
also letter characters from other languages.

Subsequent characters can include the following:

    Letters as defined in the Unicode Standard 3.2.
    Decimal numbers from either Basic Latin or other national scripts.

Regards
--------------------------------
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland

IM: m***@epprecht.net

MVP Program: http://www.microsoft.com/mvp

Blog: http://www.msmvps.com/epprecht/

Show quote
"Nancy Lytle" <lyt***@mdon-line.com> wrote in message
news:%23Q1VX9x$FHA.2156@TK2MSFTNGP11.phx.gbl...
>I am doing some testing on a database created by the programming dept of
>the company, they named the database '123v10'.
> When I run some queries (mostly admin stuff, checking the fragmentation,
> space used by the data and log files, etc) in the Query Analyzer, I often
> get the error message:
> Line 1: Incorrect syntax near '123'.
>
> My guess is that SQL doesn't particularly like database names that start
> with numbers, am I correct?  If so, will this create any real problems
> down the line?  I think we are at an early enough stage that the database
> could be renamed if this would help.
>
> TIA,
> Nancy L
>
Author
12 Dec 2005 2:03 PM
Jens
"they named the database '123v10'."

-Urgh, bad idea, if you did so put brackets around that [123v10] to
name the database, but better is to avoid numbers as first characters
in the database name.

HTH, Jens Suessmeyer.

AddThis Social Bookmark Button