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
 how to create such tables??

Author  Topic 

under2811
Constraint Violating Yak Guru

366 Posts

Posted - 2006-03-23 : 10:27:36
hello all...

i want to drop table 2Autonumber ---- table name but when i run query i am getting following error

drop table 2Autonumber

Error : Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '2'.


also know how to create such tables??

T.I.A

Papillon

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2006-03-23 : 11:05:29
object names that start with numbers, contain spaces, or other keywords and characters need to be enclosed in square brackets: [2Autonumber]

Ideally you should not even name objects with names that will require the brackets.

Be One with the Optimizer
TG
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-24 : 04:55:02
Dont use Numbers to name the objects.
Otherwise you may have this type of queries

Select [1] from [2] where [3]=4 and ([5]<6 or [7]>8)

Refer this also
http://vyaskn.tripod.com/object_naming.htm

Madhivanan

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

- Advertisement -