Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
T-SQL (SS2K5)
»
T-SQL Development Standards
T-SQL Development Standards
Rate Topic
Display Mode
Topic Options
Author
Message
G Bryant McClellan
G Bryant McClellan
Posted Thursday, October 23, 2008 11:41 AM
Right there with Babe
Group: General Forum Members
Last Login: Friday, May 17, 2013 6:13 AM
Points: 799,
Visits: 422
I've been tasked with authoring SQL Development standards for my corporation. I am starting with T-SQL and our proposed code review process.
I know there are plenty of conversations around best practices, but I am looking for more distillation than that...a guide (especially for non-declarative language developers) on the consistent ways in which code should be developed that doubles (sort of) in the end as a check-list for code reviewers.
I'm certain at least some of your companies have published development specifications of this sort. What I am looking for at the moment is a cohesive organization for the document. Can anyone lend or point me toward a simple table of contents they are using or know of that I can make use of?
------------
Buy the ticket, take the ride. -- Hunter S. Thompson
Post #590668
Goldie Lesser
Goldie Lesser
Posted Thursday, October 23, 2008 8:07 PM
SSC-Addicted
Group: General Forum Members
Last Login: Tuesday, April 16, 2013 6:34 AM
Points: 476,
Visits: 1,361
You might want to read through this post.
I found it helpful.
On the second page Jane posted an excellent standards document.
http://www.sqlservercentral.com/Forums/Topic566838-146-2.aspx
Post Attachments
DatabaseNamingConventions_v1.1.rtf
(
263 views,
122.79 KB
)
Post #590926
Jeff Moden
Jeff Moden
Posted Saturday, October 25, 2008 5:29 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 2:32 PM
Points: 32,906,
Visits: 26,792
Heh... I don't know why people even bother with any standards at all. As soon as something needs to "go in in a hurry", all notions of standards and well intended code reviews will go by the wayside.
I've attached some standards I wrote for the last company I was at. They're not simple... it covers everything except naming conventions for columns. I used to review every single piece of code that went anywhere near the database. It was a monumental but very effective job. The quality of code went from -50 to 9 on a scale of 1 to 10. No, that's not a misprint... the code was absolute crap, totally unreadable, horribly difficult to modify, full of RBAR, caused an average of 640 deadlocks per day (also not a misprint), and multiple 24-40 hour jobs dropped in duration to an average of less than 30 minutes.
But, ya gotta be will to and have management's support to just say "NO" to bad code.
Unless someone comes right out and says "These are the corporate standards and NO code will be promoted unless it meets all of the standards, including required documentation and performance/scalability tests. Your raises and, possibly, your demotions depend on how well you accept and meet these standards", no one will listen and you'll still end up with crap code.
There's a couple of changes that I actually need to make to the attached standards, but these standards were developed based on things that people did wrong at my previous company. Some of them seem to be just "stupid" because they seem like common sense... but I've found that common sense isn't so common especially in the presence of reluctent/arrogant developers and people trying to meet a schedule at any cost.
My very best wishes to you on trying to establish standards especially where embedded documentation and format are concerned. It's well worth the gargantuan effort to make the paradigm shift. Plan on becoming both the most loved and the most hated person in the company.
I've changed all the 3 letter references from my old company to "XYZ"...
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post Attachments
XYZ MS-SQL Code Standards Latest.doc
(
435 views,
1.34 MB
)
Post #591749
AnzioBake
AnzioBake
Posted Monday, October 27, 2008 1:21 AM
SSC Veteran
Group: General Forum Members
Last Login: Friday, May 17, 2013 2:43 AM
Points: 210,
Visits: 437
I second Jeffs sentiments. I had to do this aswell, and without management support DB standards get nowhere. Especially in the face of non DB developers and Administrators who think the few chapters they did in their web development course is all there is to DB work.
Now go forth and fight the good fight for the DBA's :D
GOOD LUCK
Post #591941
G Bryant McClellan
G Bryant McClellan
Posted Wednesday, November 05, 2008 9:05 AM
Right there with Babe
Group: General Forum Members
Last Login: Friday, May 17, 2013 6:13 AM
Points: 799,
Visits: 422
Jeff,
Thanks for the information. I'm also digesting a couple of books from Mr. Celko that apply.
As far as the support goes, this wasn't my idea. The idea came out during a meeting between the corporate DBAs, me (they consider me a logical DBA. I've done a lot of administration but do primarily development. They don't develop.) and the person the corporate DBAs report to.
We, too, have a lot of crap code and I've spent a lot of time rewriting it. We have had standards within our group, but I was asked to develop something more encompassing that would be corporate-wide. The project has the blessing of the CIO and the supervisor of the DBAs (who reports to the CIO) is willing to push the structure and compliance, in part by designating code reviewers in each location and establishing round-robin code review.
Obviously I am not interested in copying someone else's work but I don't want to completely invent it myself, either. But I was pretty certain that I would get something valuable from this forum.
Thanks to all.
------------
Buy the ticket, take the ride. -- Hunter S. Thompson
Post #597438
Jeff Moden
Jeff Moden
Posted Wednesday, November 05, 2008 5:39 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Yesterday @ 2:32 PM
Points: 32,906,
Visits: 26,792
Thanks for the feedback, Bryant.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #597783
chenke
chenke
Posted Wednesday, February 17, 2010 12:28 PM
Forum Newbie
Group: General Forum Members
Last Login: Thursday, September 20, 2012 10:33 AM
Points: 8,
Visits: 31
I understand this is an old forum, but in effort to add to a discussion that others may benefit from I want to share a document that might also help. I found the attached standards guide on a search for a similar topic. The link is
www.cms.hhs.gov/dbadmin/downloads/sqlserverstandardsandguildelines.pdf
. It appears to have been developed for the US Dept of Health & Human Services CMS group. But I think its a simple plain language example of a best practices document.
Post Attachments
SqlServerStandardsAndGuildelines.pdf
(
262 views,
163.96 KB
)
Post #867394
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.