From: JimLad on
Hi,

Another bog standard question. I have always used lowercase with
underscores for identifiers (this is what BOL uses in 2000). Is this
still usual or is Pascal casing more commonly used in SQL these days
(as the BOL in 2005 uses)? Is camel case ever used in SQL?

Cheers,

James
From: --CELKO-- on
The lowercase and underscores are the ISO convention and it has actual
testing behind it. Get a copy of SQL PROGRAMMING STYLE (Morgan-
Kaufmann, ISBN: 978-0-12-088797-2) for details.
From: Erland Sommarskog on
JimLad (jamesdbirch(a)yahoo.co.uk) writes:
> Another bog standard question. I have always used lowercase with
> underscores for identifiers (this is what BOL uses in 2000). Is this
> still usual or is Pascal casing more commonly used in SQL these days
> (as the BOL in 2005 uses)? Is camel case ever used in SQL?

People do all sorts of ugly things these days. Personally, I tend
to use lowercase only (and I use a case-sensitive collation). In table
and column names, I only use underscores if there is risk for confusion.
One table we have is called instrumentclearingmarketplaces. You get
used to it. :-)


--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

From: Tom Cooper on
Like Erland said, there are losts of different conventions that people use
today. I personally prefer camel case and don't like underscores because
they're awkward to type, but have been in shops which used them. I've seen
all lowercase, all uppercase, with or without underscores, Pascal case,
camel case, etc. The rules that I think should always be followed are 1)
have a standard and follow it, 2) don't use any word which is on the list of
reserved words (BOL has three lists, SQL Server reserved words, ODBC
reserved words and possible future reserved words - avoid using any of
them), 3) all names should follow the rules for valid identifiers, that is
use names that don't have to be included in brackets [], so never use, for
example, [Employee ID], and 4) in many shops the primary key of (virtually)
every table is named ID, don't do that. It's employeeid, EmployeeID,
employee_id, etc, but not ID.

Tom

"JimLad" <jamesdbirch(a)yahoo.co.uk> wrote in message
news:97fb00c6-1b1b-446a-a78e-656086dd4bd2(a)u26g2000yqu.googlegroups.com...
> Hi,
>
> Another bog standard question. I have always used lowercase with
> underscores for identifiers (this is what BOL uses in 2000). Is this
> still usual or is Pascal casing more commonly used in SQL these days
> (as the BOL in 2005 uses)? Is camel case ever used in SQL?
>
> Cheers,
>
> James

From: JimLad on
On 15 July, 23:38, "Tom Cooper" <tomcoo...(a)comcast.net> wrote:
> Like Erland said, there are losts of different conventions that people use
> today.  I personally prefer camel case and don't like underscores because
> they're awkward to type, but have been in shops which used them.  I've seen
> all lowercase, all uppercase, with or without underscores, Pascal case,
> camel case, etc.  The  rules that I think should always be followed are 1)
> have a standard and follow it, 2) don't use any word which is on the list of
> reserved words (BOL has three lists, SQL Server reserved words, ODBC
> reserved words and possible future reserved words - avoid using any of
> them), 3) all names should follow the rules for valid identifiers, that is
> use names that don't have to be included in brackets [], so never use, for
> example, [Employee ID], and 4) in many shops the primary key of (virtually)
> every table is named ID, don't do that.  It's employeeid, EmployeeID,
> employee_id, etc, but not ID.
>
> Tom
>
> "JimLad" <jamesdbi...(a)yahoo.co.uk> wrote in message
>
> news:97fb00c6-1b1b-446a-a78e-656086dd4bd2(a)u26g2000yqu.googlegroups.com...
>
>
>
> > Hi,
>
> > Another bog standard question. I have always used lowercase with
> > underscores for identifiers (this is what BOL uses in 2000). Is this
> > still usual or is Pascal casing more commonly used in SQL these days
> > (as the BOL in 2005 uses)? Is camel case ever used in SQL?
>
> > Cheers,
>
> > James- Hide quoted text -
>
> - Show quoted text -

Again guys, many thanks.

James
 |  Next  |  Last
Pages: 1 2
Prev: Semicolons
Next: Unexpected Join behavior