|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Database Namingam 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 > My guess is that SQL doesn't particularly like database names that start Yes, you are correct. However, it should not cause problems if you code > 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. defensively (which you should be doing anyways). The problem is that the creator of the name did not follow the rules for regular identifiers. If you don't follow the rules, then you must take extra steps to properly delimit the identifier name (this includes all object names - databases, triggers, procedures, tables, etc.). Obviously, the easiest approach is to follow the rules.
Show quote
"Scott Morris" <bo***@bogus.com> wrote in message To add to that. Ensure that you use square brackets [ ] whenever you news:eUt9vPN$FHA.360@TK2MSFTNGP09.phx.gbl... >> 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. > > Yes, you are correct. However, it should not cause problems if you code > defensively (which you should be doing anyways). The problem is that the > creator of the name did not follow the rules for regular identifiers. If > you don't follow the rules, then you must take extra steps to properly > delimit the identifier name (this includes all object names - databases, > triggers, procedures, tables, etc.). Obviously, the easiest approach is > to follow the rules. > reference the db name. Rick Sawtell You may get it to work by using brackets around the db name like [123xxx],
however, somewhere down the road there will perhaps be a query or application that will choke on it. It would be best to nip it in the bud now. Show quote "Nancy Lytle" <word_d***@hotmail.com> wrote in message news:O0YWoDN$FHA.216@TK2MSFTNGP15.phx.gbl... > 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 > > |
|||||||||||||||||||||||