I'm looking for a concise guide to SQL programming style -- covering things
like naming conventions and other best practices or de facto standards.
Yes - I found Celko's SQL Programming Style book and plan to get a copy; I'd
also appreciate recommendations for something a bit more consise.
Thanks!Celko's book is only a couple hundred pages but has a lot of good info.
Here's a nice concise summary of a naming convention for you:
* When possible use only letters A - Z, underscore character (_), numeric
digits 0 - 9 and unicode standard 3.2 "letters" for names
* Avoid using "@.@." as a prefix for local variable names
* Don't use T-SQL reserved words as identifiers; you might want to avoid
ODBC reserved words as well
* Limit the length of identifiers (I find about 30 characters or less works
nicely)
* Use underscore characters and/or mixed case to differentiate words in
identifiers; avoid all upper- or all lower-case for identifiers
* Don't use "sp_" as a prefix for stored procedures (also avoid "xp_", "dt_"
and "MS_" prefixes).
* Choose a style and be consistent (don't call your local variable
@.myLocalVariable in one place and @.MYlocalVARIABLE in another - makes it
difficult to read and might cause problems in a case-sensitive DB).
"Jeff" <A@.B.COM> wrote in message
news:eqwIPacjGHA.4512@.TK2MSFTNGP02.phx.gbl...
> I'm looking for a concise guide to SQL programming style -- covering
> things like naming conventions and other best practices or de facto
> standards. Yes - I found Celko's SQL Programming Style book and plan to
> get a copy; I'd also appreciate recommendations for something a bit more
> consise.
> Thanks!
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment