Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Numeric Table Names

Author  Topic 

SamuelT
Starting Member

6 Posts

Posted - 2007-08-10 : 11:55:42
Hi all,

I'm trying to create a number of tables that relate to projects which have numberic names (e.g. 93002, 93009, 93012). However it appears that I'm unable to create a table with numeric values. When I try to create the table I get:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.93009'.

Am I right in presumung that I can't create numerically named tables, and can anyone suggest a naming convention that isn't NineThreeZeroZeroNine ?

TIA,

SamuelT

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-08-10 : 12:14:44
Use brackets around the number.

Create table dbo.[93002]
...


Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2007-08-10 : 12:53:19
This is a really, really bad database design. Your tables should *contain* data, not *be* data. If you have multiple projects, they should all be stored in one "Projects" table with a "ProjectCode" column that stores the project number. A design like you are trying to do will be a nightmare to maintain.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-08-10 : 13:17:01
quote:
Originally posted by jsmith8858

This is a really, really bad database design. Your tables should *contain* data, not *be* data. If you have multiple projects, they should all be stored in one "Projects" table with a "ProjectCode" column that stores the project number. A design like you are trying to do will be a nightmare to maintain.

- Jeff
http://weblogs.sqlteam.com/JeffS




Totally agree.

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-08-13 : 01:54:01

http://www.datamodel.org/NormalizationRules.html


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

SamuelT
Starting Member

6 Posts

Posted - 2007-08-13 : 04:38:19
Hi,

Thanks for the advice ( 'This is a really, really bad database design'!!!). I already have a Project table that lists all the project codes - I also have a Sites table. I've joined these two tables to list all sites that are related to jobs (ProjectSites).

The reason for extracting this data to a seperate table is that I want individual tables for each project as each is bespoke and contains various milestones that need reporting against. If this still appears to be really, really bad () how would you guys go about doing this?

TIA,

SamuelT
Go to Top of Page
   

- Advertisement -