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 2008
»
SQL Server 2008 - General
»
ms standards doc?
13 posts, Page 1 of 2
1
2
»»
ms standards doc?
Rate Topic
Display Mode
Topic Options
Author
Message
sqlguy-736318
sqlguy-736318
Posted Wednesday, September 19, 2012 3:11 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Thursday, May 16, 2013 4:21 PM
Points: 106,
Visits: 255
Does Microsoft provide a standards document for SS design standards?
For example: "Column names should be Pascal-cased - ex - FirstName"
Post #1361644
Lowell
Lowell
Posted Wednesday, September 19, 2012 3:19 PM
SSChampion
Group: General Forum Members
Last Login: Today @ 3:06 PM
Points: 11,638,
Visits: 27,712
there's more than a few great threads here on SSC on the subject: i think all of the threads here have actual documents attached from various posters as well.
http://www.sqlservercentral.com/Forums/Topic590668-338-1.aspx
http://www.sqlservercentral.com/Forums/Topic857703-391-1.aspx
http://www.sqlservercentral.com/Forums/Topic560087-145-1.aspx
Lowell
--
There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1361650
sqlguy-736318
sqlguy-736318
Posted Wednesday, September 19, 2012 3:29 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Thursday, May 16, 2013 4:21 PM
Points: 106,
Visits: 255
Based on my initial scan of the threads the threads don't appear to reference any official MS standards.
MS provides an automated tool named FXCop to check a .NET/C# codebase for code that doesn't comply to MS standards.
I guess MS doesn't provide anything similar for SS?
Post #1361658
Lynn Pettis
Lynn Pettis
Posted Wednesday, September 19, 2012 3:37 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 4:34 PM
Points: 21,615,
Visits: 27,445
sqlguy-736318 (9/19/2012)
Based on my initial scan of the threads the threads don't appear to reference any official MS standards.
MS provides an automated tool named FXCop to check a .NET/C# codebase for code that doesn't comply to MS standards.
I guess MS doesn't provide anything similar for SS?
No, there isn't.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #1361667
ScottPletcher
ScottPletcher
Posted Wednesday, September 19, 2012 3:40 PM
Ten Centuries
Group: General Forum Members
Last Login: Today @ 3:56 PM
Points: 1,324,
Visits: 1,778
I think MS had that at one point but they dropped it.
In general, carefully determine rules among yourselves and
most of all, consistently follow them
.
FWIW, here are my suggested rules:
Avoid special characters, obviously, and do not start any name with a digit; underscores are OK, of course. In fact, I prefer them to "MixedCase" naming == mixed_case .
DO NOT prefix table names with "tbl" or the equivalent. It's unnecessary, and could be false, since if the table changes to a view you won't rename it anyway.
Table names are plural. Technically, I think singular names are more theoretically accurate, but the overwhelming number of table names are plural, so I swim with the river.
Same rules for views as tables, for the same reasons.
DO NOT use a table prefix on column names. For example, on the orders table: NOT ord_id, ord_date, ord_cust INSTEAD JUST id, order_date, customer, etc..
DO NOT put the (abbreviated) data type in a column name, except as part of a normal column name.
So, no intId or dttmOrderDate.
But order_date as column name is OK, of course, since "date" is inherently descriptive of the column data itself.
Decide on rules for naming table-related items -- indexes, constraints, triggers, etc. -- and stick to them. I prefer the "full_table_name__{CL|DF|IX|TR...}" as a prefix to
all
table "parts" (I think MS's practice of a "PK_"
prefix
makes NO sense).
But use any rules for that that meets your needs,
JUST ENFORCE IT
.
Policy-based mgmt is good for that, but you can even use after-the-fact queries to validate object names.
SQL DBA,SQL Server MVP('07, '08, '09)
One man with courage makes a majority. Andrew Jackson
Post #1361669
Lynn Pettis
Lynn Pettis
Posted Wednesday, September 19, 2012 3:44 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 4:34 PM
Points: 21,615,
Visits: 27,445
Also, don't name your procedures with "sp_" as you may run afoul of a Microsoft system stored procedure of the same name.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #1361672
ScottPletcher
ScottPletcher
Posted Wednesday, September 19, 2012 3:52 PM
Ten Centuries
Group: General Forum Members
Last Login: Today @ 3:56 PM
Points: 1,324,
Visits: 1,778
Lynn Pettis (9/19/2012)
Also, don't name your procedures with "sp_" as you may run afoul of a Microsoft system stored procedure of the same name.
Quite true! In fact, don't start ANY name with "sp_".
Or "sys".
You might also want to avoid table/view names starting with any of these:
filestream
MS
queue
SQL DBA,SQL Server MVP('07, '08, '09)
One man with courage makes a majority. Andrew Jackson
Post #1361675
sqlguy-736318
sqlguy-736318
Posted Wednesday, September 19, 2012 4:13 PM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Thursday, May 16, 2013 4:21 PM
Points: 106,
Visits: 255
I think it's unfortunate that MS doesn't provide an automated tool to review a SS database for standards compliance. The nice thing about FXCop is that it's somewhat easier to convince an organization to use FxCop to enforce "Microsoft Standards".
Is there an automated SQL standards tool available that validates databases based on rules published by some other recognized SQL standards organization?
Post #1361682
Lynn Pettis
Lynn Pettis
Posted Wednesday, September 19, 2012 4:22 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 4:34 PM
Points: 21,615,
Visits: 27,445
sqlguy-736318 (9/19/2012)
I think it's unfortunate that MS doesn't provide an automated tool to review a SS database for standards compliance. The nice thing about FXCop is that it's somewhat easier to convince an organization to use FxCop to enforce "Microsoft Standards".
Is there an automated SQL standards tool available that validates databases based on rules published by some other recognized SQL standards organization?
First, whose standards.
Second, none that I know of.
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #1361685
ScottPletcher
ScottPletcher
Posted Wednesday, September 19, 2012 4:37 PM
Ten Centuries
Group: General Forum Members
Last Login: Today @ 3:56 PM
Points: 1,324,
Visits: 1,778
sqlguy-736318 (9/19/2012)
I think it's unfortunate that MS doesn't provide an automated tool to review a SS database for standards compliance. The nice thing about FXCop is that it's somewhat easier to convince an organization to use FxCop to enforce "Microsoft Standards".
Is there an automated SQL standards tool available that validates databases based on rules published by some other recognized SQL standards organization?
Once you decide on the rules you want, you can put them into PBM and it can check and/or enforce them for you.
SQL DBA,SQL Server MVP('07, '08, '09)
One man with courage makes a majority. Andrew Jackson
Post #1361690
« Prev Topic
|
Next Topic »
13 posts, Page 1 of 2
1
2
»»
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.