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
 SQL Table

Author  Topic 

dr223
Constraint Violating Yak Guru

444 Posts

Posted - 2011-09-20 : 05:23:49
Hi,

I am creating a SQL table in my database. I have a field which has a column name as current, so when I type current and tab away to enter the data type - the column is changed to [current] and not current.

Why is this happening? Can I force it to be current instead? Is it advisable?

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-20 : 05:37:27
that means current is reserved word so it need to put those [] to identify this as a column name instead in this context otherwise it will interpret it as reserved word and throw error

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -