Click here to Skip to main content
12,403,130 members (69,489 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 21:16
memberHua Yujun1-Apr-13 21:16 
Questiongood Pin
Hua Yujun1-Apr-13 20:44
memberHua Yujun1-Apr-13 20:44 
Questiongood Pin
Hua Yujun1-Apr-13 20:44
memberHua Yujun1-Apr-13 20:44 
Questiongood Pin
Hua Yujun1-Apr-13 19:51
memberHua Yujun1-Apr-13 19:51 
GeneralNice Pin
ramakrishnankt22-Nov-11 20:22
memberramakrishnankt22-Nov-11 20:22 
QuestionAny Update? Pin
jhigaki9-Jul-08 6:06
memberjhigaki9-Jul-08 6:06 
AnswerRe: Any Update? Pin
Casper Leon Nielsen30-Sep-08 23:21
memberCasper Leon Nielsen30-Sep-08 23:21 
GeneralTable Naming - Statement Formatting Pin
Ahmed_Barakat31-Jan-08 6:16
memberAhmed_Barakat31-Jan-08 6:16 
GeneralRe: Table Naming - Statement Formatting Pin
Casper Leon Nielsen30-Sep-08 23:19
memberCasper Leon Nielsen30-Sep-08 23:19 
QuestionNOLOCK? Pin
Rhodesie28-Sep-06 6:33
memberRhodesie28-Sep-06 6:33 
AnswerRe: NOLOCK? Pin
Casper Leon Nielsen28-Sep-06 23:12
memberCasper Leon Nielsen28-Sep-06 23:12 
GeneralRe: NOLOCK? Pin
Casper Leon Nielsen29-Sep-06 0:29
memberCasper Leon Nielsen29-Sep-06 0:29 
GeneralRe: NOLOCK? Pin
Rhodesie1-Oct-06 22:59
memberRhodesie1-Oct-06 22:59 
Answerderived tables Pin
Casper Leon Nielsen28-Sep-06 23:15
memberCasper Leon Nielsen28-Sep-06 23:15 
GeneralDiscussion on joelonsoftware Pin
Casper Leon Nielsen24-Sep-06 10:50
memberCasper Leon Nielsen24-Sep-06 10:50 
Generalprefixing stored procedures with sp_ is bad practice Pin
KinStephen21-Sep-06 13:13
memberKinStephen21-Sep-06 13:13 
AnswerAnd the standard says you shouldnt Pin
Casper Leon Nielsen21-Sep-06 20:53
memberCasper Leon Nielsen21-Sep-06 20:53 
GeneralRe: And the standard says you shouldnt Pin
KinStephen22-Sep-06 7:21
memberKinStephen22-Sep-06 7: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 8:33
memberCasper Leon Nielsen22-Sep-06 8:33 
GeneralRe: Conclusion Pin
KinStephen22-Sep-06 11:28
memberKinStephen22-Sep-06 11:28 
GeneralWhy not... Pin
Colin Angus Mackay21-Sep-06 3:41
memberColin Angus Mackay21-Sep-06 3:41 
AnswerRe: Why not... Pin
Casper Leon Nielsen21-Sep-06 3:57
memberCasper Leon Nielsen21-Sep-06 3:57 
GeneralAvoid using the blob type - NOT Pin
__alias21-Sep-06 3:24
member__alias21-Sep-06 3:24 
QuestionRe: Avoid using the blob type - NOT Pin
Casper Leon Nielsen21-Sep-06 3:34
memberCasper Leon Nielsen21-Sep-06 3:34 
AnswerRe: Avoid using the blob type - NOT Pin
__alias21-Sep-06 10:14
member__alias21-Sep-06 10:14 
GeneralRe: Avoid using the blob type - NOT Pin
Casper Leon Nielsen21-Sep-06 23:53
memberCasper Leon Nielsen21-Sep-06 23:53 
GeneralRe: Avoid using the blob type - NOT Pin
Casper Leon Nielsen22-Sep-06 0:38
memberCasper Leon Nielsen22-Sep-06 0:38 
GeneralRe: Avoid using the blob type - NOT Pin
__alias22-Sep-06 2:28
member__alias22-Sep-06 2:28 

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
Web01 | 2.8.160721.1 | Last Updated 1 Oct 2008
Article Copyright 2006 by Casper Leon Nielsen
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid