You might want to reconsider that. It could bite you in the future.

I had a table built in SQL 2000 that had a field RANK.  All of my queries 
referenced it as [RANK] and everyone made fun of me because of putting the [] 
around objects. When we were upgraded to sql 2008 (yes there was a version 
skip) all of my stuff worked just fine, but a lot of theirs gave weird results 
because RANK became a function and a reserved word in SQL. Using [], "" or 
whatever your specific DB uses allows for future proofing.

Steve


-----Original Message-----
From: Michael Dinowitz [mailto:[email protected]] 
Sent: Wednesday, January 22, 2014 2:35 PM
To: sql
Subject: Re: underscore prefix for table name


My style rejects anything that would require me to use brackets around a
table, column, or any other name.


On Tue, Jan 21, 2014 at 8:11 PM, George Gallen <[email protected]> wrote:

>
> You could always surround it with [ and ] like [_TABLENAME_]
>
> > On Jan 21, 2014, at 8:01 PM, "Michael Dinowitz" <
> [email protected]> wrote:
> >
> >
> > I use an underscore for look-up tables in an MS SQL2008 DB. To me, a
> > look-up table is anything that will almost never change. Things like
> > _roles, _states, _ethnicity. According to one book, an underscore as a
> > prefix should not be allowed but in practice it does not seem to cause
> any
> > problems.
> > Has anyone seen any problems with this? I'm writing up a sql conventions
> > spec for a contract.
> >
> > Thanks
> > Michael
> >
> >
> >
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/sql/message.cfm/messageid:3528
Subscription: http://www.houseoffusion.com/groups/sql/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/sql/unsubscribe.cfm

Reply via email to