Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

T-SQL Development Standards Expand / Collapse
Author
Message
Posted Thursday, October 23, 2008 11:41 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, October 30, 2014 5:30 AM
Points: 847, Visits: 477
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
Posted Thursday, October 23, 2008 8:07 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Monday, November 17, 2014 8:14 AM
Points: 478, Visits: 1,420
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 (331 views, 122.79 KB)
Post #590926
Posted Saturday, October 25, 2008 5:29 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 4:36 PM
Points: 35,546, Visits: 32,131
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 "Row-By-Agonizing-Row".

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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems


  Post Attachments 
XYZ MS-SQL Code Standards Latest.doc (530 views, 1.34 MB)
Post #591749
Posted Monday, October 27, 2008 1:21 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, November 19, 2014 2:05 AM
Points: 211, Visits: 580
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
Posted Wednesday, November 5, 2008 9:05 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, October 30, 2014 5:30 AM
Points: 847, Visits: 477
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
Posted Wednesday, November 5, 2008 5:39 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 4:36 PM
Points: 35,546, Visits: 32,131
Thanks for the feedback, Bryant.

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #597783
Posted Wednesday, February 17, 2010 12:28 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, April 7, 2014 10:49 AM
Points: 8, Visits: 37
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 (333 views, 163.96 KB)
Post #867394
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse