Download SQL SERVER Database Coding Standards and Guidelines Complete List
Just like my previous series of SQL Server Interview Questions and Answers Complete List Download, I have received many comments and emails regarding this series. Once I go through all the emails and comments, I will make summary of them and integrate them with my series. I have also received emails asking me to create PDF for download. I have created that as well. Please feel free to download it and use it.
Please ask me any questions you might have. Contact me if you are interested in writing mini series with me.
Download SQL SERVER Database Coding Standards and Guidelines Complete List
Complete Series of Database Coding Standards and Guidelines
SQL SERVER Database Coding Standards and Guidelines - Introduction
SQL SERVER - Database Coding Standards and Guidelines - Part 1
SQL SERVER - Database Coding Standards and Guidelines - Part 2
SQL SERVER Database Coding Standards and Guidelines Complete List Download
Other popular Series
SQL Server Interview Questions and Answers Complete List Download
SQL SERVER - Data Warehousing Interview Questions and Answers Complete List Download






Useful Notes
Hi Pinal,
That is a Very Very Good Compiled Document. Appreciate it
However, just one things i noticed. Please correct me if i am wrong.
Stored Procedure Naming Convention
- Is it feasible to start the User Created Stored procedure Name with “sp” ,since SQL Server looks for the Stored Procedure in the Master Database and assumes it to be as a System defined Stored Procedure?
I know you have mentioned not to start with “sp_”, but just a thought.
Thanks
Deepan S.
Thanks Deepan,
As far as I know ‘SPName’ is no problem but ’sp_’. When I reviewed this document and that particular issue with other SQL Expert, we all agreed that it is fine.
If anybody has other opinion or documentation. I am willing to adopt, but at this moment I think ’spNAME’ (no underscore) is fine.
Regards,
Pinal Dave (SQLAuthority.com)
very good articles keep doing things more and more
Its Really Good Article…
Best Of Luck for Bright Future…..
really great articals to be referred by any .net programmer.
thanks to pinal dave……..
Really fantastic…!
hi pinal,
This site is very much usefull
thanks to u
Thanks,
Vinod Dhone
Hello Mr. Dave,
Your articles are amazing and really very useful. I am a beginner in SQL BI and looking for resources, interview questions. It would be a great help if you can point me to those resources.
Thanks
Hi. Nice articles but I am interested in why you would want to prefix all stored procedures with ’sp’. In the case of stored procedures I understand there is no impact but it seems superfluous and makes the natural reading of code less easy.
It reminds me somewhat of the polish notation used by many VB programmers that in the end leads to problems. Luckily ones that don’t currently afflict SQL.
Hello Mr. Dave,
Your articles are amazing and really very useful. This should
be done by each professional to encourage the begginners.
your work is really appreciable.
Go ahead
Thanks
sachin
Coding standards are very usefull. i like it very much. keep it up boyz.
Hi,
The articals are really very useful,keep uploading these type of DOC
Hi,
I think you should add the (NOLOCK) attribute as well.
eg:
SELECT UserID FROM [User] (NOLOCK)
or
SELECT u.UserID,s.SessionID FROM [User] u (NOLOCK) INNER JOIN [Session] s (NOLOCK) ON u.UserID=s.UserID
Jaysam
Its very good work done by you people.
I really thankful to u……..
Keep Uploading such good technical stuff. Thanks
this is very important .and very easy way to understanding
its nice
[...] Read SQL SERVER Database Coding Standards and Guidelines Complete List Download [...]
hi Pinal Dave, I just graduated with a degree in network communication and management i would like to know of any more info to help me learn the sql server to further my carrer. i am studying now for my ccna and want all the expeirence i can get to futher myself if u can help i would greatly appreciate the info to learn maybe some books you could recommend. i am egar to learn from someone who has such a vast knowledge of this field
thanks R.Haynes
Excellent Web Site.
Thank you, I really appreciate your work. I hope one day I will be able to give back too.
I want to appreciate the author of this documents
keep the gud work up.
hello pinal Dave
i am really happy with u r articles
Good Pinal Dave,
Keep updating the things……….
I want to send some new concept of performance tunning and new way of using sql server 2005 coding stratergy. I will appreciate you if you can provide me your mail ID so that i can send you the document which i Collect from my learnings………
Thanks & Regards
Shashi Kant Chauhan
how can i count number of column in a row with same data?
i have a table with column empid,month, day1, day2 ………….day31 i want to count number of ‘p’ and ‘a’ of that employee id?
You are really good man. Your effort with no charge is really appreciable.
God bless you.
Rana
i am not written this for u .because i really dont no which word i say to u. no word is expressed to u.U R a very tallented person ,u have a great capabilities to done all u r effort.u also done a work that needed all jobseekers like me.
i just searches SQL related questions with ansers ,and i get this wonderful and easy solution from u.
thanks ,may have 2 requst u plz contact with me.
best of luck u r next …………………………………………………………………..
till end
Hi!
Its very nice and helpful link for me and all sql users.
regards,
Ganesh Jamdurkar
Hi!
Its very nice and helpful link for me and all sql users.
regards,
Faisal Qureshi
Wonderful website..appreciate the effort.
Arvind
hi
it is very useful and necessary to all who are all using sql server. keep on adding tips
regards,
ravi
Hi pinaldave,
Very usefull article keep going.
[...] It is very easy to add column and specify default constraint. I have seen many examples where constraint name is not specified, if constraint name is not specified SQL Server will generate unique name for itself. I prefer to specify my constraint name as per my coding standards. You can read my coding standard here : SQL SERVER Database Coding Standards and Guidelines Complete List Download [...]
CONNECTION OF SQL SERVER 2005 TABLES WITH VISUAL STUDIO 2005
Hi,
wha is the command used to count foreign key in a table.
[...] SQL SERVER Database Coding Standards and Guidelines Complete List Download [...]
Hi Pinal,
Exist standars in SQL for creation views ?
Thanks
Cesar
thats very nice tips! lucky i found your article. that save a lot of my time to fix my problem.
it is nice to read ,very interesting.
hi everyone can you tell me the steps of how to disable procedure in sql 2000 and 2005
Hi Pinal Dave,
Surprising greatly. Keep good work. Now I am addicted this website.
[...] 2, 2008 by pinaldave Christopher Miller read article of SQL SERVER Database Coding Standards and Guidelines Complete List Download and came up with wonderful SQL Server Script to rename all their database constraint with more [...]
Hi,
It is a very very good article. I never think these kind of questions. Thanks a lot for doing research on it and all the best for further research.
Regards
Sajitha
Hello,
Great document!
I noticed you recommend having your table names be ‘plural’. It seems there are those who are passionate about making them singular. I was wondering what your reasoning is for doing it your way.
Thanks
Frank
Its a fantastic job,your work will help many developers and God is almighty with you
Hi Pinal,
Really appreciate the work you have done.
Have a question for you in regards to SQL Server Database Coding Standards and Guidelines
Other than keeping within ANSI92 or being Oracle compatible why do you say “Do not use the identitycol or rowguidcol”?
Thanks keep up the good work!!
Zach
Hi Pinal
Really nice compilation. I am greately benifitted.
I was going thru your article on Coding Standards. You have mentioned
“Use BEGIN..END blocks only when multiple statements are present within a conditional code
segment.”
I think we should always use BEGIN…END blocks. Anyone else maintaining a code that I have written may put another line and lured by the indent think that he has put the statement inside the block. Later this may be a nightmare for the third person to debug.
hello sir,
can u tell why u r not use more than one oprimary key on a table
HI
I am preparing for interviews.
If you can send me latest interview questions on SQL and PL?SQL that would be great.
Site is very useful
[...] 13, 2008 by pinaldave I have previous written article about SQL SERVER Database Coding Standards and Guidelines Complete List Download. I just received question from one of the blog reader is there any way we can just prevent [...]
Hi,
Great document!
I noticed you recommend having table names as ‘plural’ but table is an entity and i think an entity should always be in ’singular’. Correct me if i am wrong
Thanks
Ashok
Hi!
very nice and helpful link.
Regards,
R.Wright
I agree with most of your guidelines. One that I don’t agree with, is using varchar instead of TEXT. TEXT results in a 16-byte only fixed column, while a varchar(max) could result in 8KB being accessed by the HDD and sent to the resultset. It just serves better to have a huge amount of data off-table and only accessed when needed. Even if a SELECT list is provided, excluding the varchar, the hard drive still has to read all of it into the page before producing the selective list, which is a waste.
Ordinarily, I try to assess the maxlength of a varchar and its usability, and if it’s going to be used infrequently and could be very large, it goes into a TEXT column.
One guideline I use that you didn’t mention, is to have keys at the front of the table, followed by fixed-length columns and variable length columns at the end of the table. Your assessment that varchars are faster to process than chars is only valid when the column length is large. Varchars require the application of a base address with an off-set to reach them. If one places fixed-length columns behind varchars, they, too, will be subject to an off-set. Setting relationships against columns behind varchars places a huge overhead burden on the server.
Just some thoughts.
I want list of pratical question of sql server 2000.
Where i will get?
PLEASE GIVE ME THE TIPS ABOU SQL CONTRAINT WORK
Hi Pinal,
Impressive stuff!
I am currently looking for a tool which verifies whether SQL standards are met in the in the SQL script. For example if a input a stored procedure script then i would like see a report on what all predefined coding standards not met in the stored procedure.
Do you know any tools available like that or let me know pointers to build that kind of a tool.
HI
I am preparing for interviews.
If you can send me latest interview questions on SQL and PL?SQL that would be great.
Site is very useful
hi
i am fresher.i don’t know sql server.please give more tips for sql server 2005 and sql server 2008