Click here to Skip to main content
11,934,783 members (47,133 online)
Click here to Skip to main content
Add your own
alternative version


34 bookmarked

T-SQL Coding Standard

, 1 Oct 2008 CPOL
Rate this:
Please Sign up or sign in to vote.
T-SQL Coding Standard - for programming the Microsoft SQL Server 2005 (DRAFT)


I am currently working on a T-SQL coding standard to formalize our work. Having been inspired by the IDesign C# Coding Standard, I made this T-SQL Coding Standard Document. Maybe this will have some value for the community. It is work in progress and I intend to update it as my experience with its implementation continues.

Unfortunately, I wrote the document in Word using loads of formatting and CodeProject's editor cannot display the document directly. Instead, I leave the document here in a zip for download.

When the document has matured some more, I will reformat it in HTML and modify this article.

Casper Leon Nielsen - 21. Sep 2006. (modified 1st October 2008)


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Casper Leon Nielsen
Architect HelloGroup
Denmark Denmark
Casper Leon Nielsen is a MCP/MCAD and is currently employed by HelloGroup a/s - a technical savy (yes that whats they are calling it these days) company.

You may also be interested in...

Comments and Discussions

Questiongood Pin
Hua Yujun1-Apr-13 22:16
memberHua Yujun1-Apr-13 22:16 
Questiongood Pin
Hua Yujun1-Apr-13 21:44
memberHua Yujun1-Apr-13 21:44 
Questiongood Pin
Hua Yujun1-Apr-13 21:44
memberHua Yujun1-Apr-13 21:44 
Questiongood Pin
Hua Yujun1-Apr-13 20:51
memberHua Yujun1-Apr-13 20:51 
GeneralNice Pin
ramakrishnankt22-Nov-11 21:22
memberramakrishnankt22-Nov-11 21:22 
QuestionAny Update? Pin
jhigaki9-Jul-08 7:06
memberjhigaki9-Jul-08 7:06 
AnswerRe: Any Update? Pin
Casper Leon Nielsen1-Oct-08 0:21
memberCasper Leon Nielsen1-Oct-08 0:21 
GeneralTable Naming - Statement Formatting Pin
Ahmed_Barakat31-Jan-08 7:16
memberAhmed_Barakat31-Jan-08 7:16 
GeneralRe: Table Naming - Statement Formatting Pin
Casper Leon Nielsen1-Oct-08 0:19
memberCasper Leon Nielsen1-Oct-08 0:19 
QuestionNOLOCK? Pin
Rhodesie28-Sep-06 7:33
memberRhodesie28-Sep-06 7:33 
AnswerRe: NOLOCK? Pin
Casper Leon Nielsen29-Sep-06 0:12
memberCasper Leon Nielsen29-Sep-06 0:12 
GeneralRe: NOLOCK? Pin
Casper Leon Nielsen29-Sep-06 1:29
memberCasper Leon Nielsen29-Sep-06 1:29 
GeneralRe: NOLOCK? Pin
Rhodesie1-Oct-06 23:59
memberRhodesie1-Oct-06 23:59 
Answerderived tables Pin
Casper Leon Nielsen29-Sep-06 0:15
memberCasper Leon Nielsen29-Sep-06 0:15 
GeneralDiscussion on joelonsoftware Pin
Casper Leon Nielsen24-Sep-06 11:50
memberCasper Leon Nielsen24-Sep-06 11:50 
Generalprefixing stored procedures with sp_ is bad practice Pin
KinStephen21-Sep-06 14:13
memberKinStephen21-Sep-06 14:13 
AnswerAnd the standard says you shouldnt Pin
Casper Leon Nielsen21-Sep-06 21:53
memberCasper Leon Nielsen21-Sep-06 21:53 
GeneralRe: And the standard says you shouldnt Pin
KinStephen22-Sep-06 8:21
memberKinStephen22-Sep-06 8:21 
I was pointing out the standard is incorrect and should be changed. You shouldn't prefix stored procedurs with sp_ due to performance issues and you shouldn't prefix them with sp (stands for system procedure) as this can cause confusion between user stored procdures and system stored procedures. Why not be more descriptive and prefix them with usp (user stored procedure)?

Or another option is why not go with just p for procedure, since technically a function is also a stored function (or stored procedure with a return value).




AnswerConclusion [modified] Pin
Casper Leon Nielsen22-Sep-06 9:33
memberCasper Leon Nielsen22-Sep-06 9:33 
GeneralRe: Conclusion Pin
KinStephen22-Sep-06 12:28
memberKinStephen22-Sep-06 12:28 
GeneralWhy not... Pin
Colin Angus Mackay21-Sep-06 4:41
memberColin Angus Mackay21-Sep-06 4:41 
AnswerRe: Why not... Pin
Casper Leon Nielsen21-Sep-06 4:57
memberCasper Leon Nielsen21-Sep-06 4:57 
GeneralAvoid using the blob type - NOT Pin
__alias21-Sep-06 4:24
member__alias21-Sep-06 4:24 
QuestionRe: Avoid using the blob type - NOT Pin
Casper Leon Nielsen21-Sep-06 4:34
memberCasper Leon Nielsen21-Sep-06 4:34 
AnswerRe: Avoid using the blob type - NOT Pin
__alias21-Sep-06 11:14
member__alias21-Sep-06 11:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.151126.1 | Last Updated 1 Oct 2008
Article Copyright 2006 by Casper Leon Nielsen
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid