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 12»»

ms standards doc? Expand / Collapse
Author
Message
Posted Wednesday, September 19, 2012 3:11 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, May 8, 2014 5:29 PM
Points: 121, Visits: 300
Does Microsoft provide a standards document for SS design standards?

For example: "Column names should be Pascal-cased - ex - FirstName"
Post #1361644
Posted Wednesday, September 19, 2012 3:19 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 7:44 AM
Points: 12,910, Visits: 32,015
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
Posted Wednesday, September 19, 2012 3:29 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, May 8, 2014 5:29 PM
Points: 121, Visits: 300
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
Posted Wednesday, September 19, 2012 3:37 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 12:11 PM
Points: 23,296, Visits: 32,034
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
Posted Wednesday, September 19, 2012 3:40 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 2:25 PM
Points: 2,044, Visits: 3,059
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)
"In America, every man is innocent until proven broke!" Brant Parker
Post #1361669
Posted Wednesday, September 19, 2012 3:44 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 12:11 PM
Points: 23,296, Visits: 32,034
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
Posted Wednesday, September 19, 2012 3:52 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 2:25 PM
Points: 2,044, Visits: 3,059
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)
"In America, every man is innocent until proven broke!" Brant Parker
Post #1361675
Posted Wednesday, September 19, 2012 4:13 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, May 8, 2014 5:29 PM
Points: 121, Visits: 300
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
Posted Wednesday, September 19, 2012 4:22 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 12:11 PM
Points: 23,296, Visits: 32,034
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
Posted Wednesday, September 19, 2012 4:37 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 2:25 PM
Points: 2,044, Visits: 3,059
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)
"In America, every man is innocent until proven broke!" Brant Parker
Post #1361690
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse