Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ashearer
Starting Member
2 Posts |
Posted - 2005-04-07 : 19:27:29
|
hi, this is my first post on sqlteam.com, so forgive me if this topic has been covered before. I am wondering if anyone knows of Microsoft standards/guidelines for the layout and formatting of stored procedures??Btw- does SQL Yukon, and the integration into the development IDE provide automatic SQL formatting, like is does with VB.net??ThanksAndrew |
|
|
simondeutsch
Aged Yak Warrior
547 Posts |
Posted - 2005-04-07 : 21:10:33
|
| I don't know if these are Microsoft standards, but common is to1. Comment liberally using /**/ and --, if anyone, or even you, ever has to look at your code. And code that may seem perfectly simple and sensible today will be incomprehensible tomorrow without comments. Famous last words: "What the hell does this line do?"2. Indent every block equally.3. I like to put all my DECLAREs together at the top.4. Use SET NOCOUNT ON/OFF at the beginning and end of every proc to avoid skewered results by data providers.Sarah Berger MCSD |
 |
|
|
ashearer
Starting Member
2 Posts |
Posted - 2005-04-07 : 22:22:02
|
quote: Originally posted by simondeutsch 2. Indent every block equally.
this can be interpreted in so many ways….i.e.Select Column 1 Column 2From TableWhere ConditionOrSelect Column 1 Column 2From TableWhere Conditionsorry, the plaintext formatting doesn't work, but you can imagine the indentation above |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-04-07 : 23:42:47
|
quote: Originally posted by ashearer hi, this is my first post on sqlteam.com, so forgive me if this topic has been covered before. I am wondering if anyone knows of Microsoft standards/guidelines for the layout and formatting of stored procedures??Btw- does SQL Yukon, and the integration into the development IDE provide automatic SQL formatting, like is does with VB.net??ThanksAndrew
none that i know of, formats are developed as per DBA or Developer's experience and these formats should be consistent and agreed by the team and should be understood by the team who will read/modify it--------------------keeping it simple... |
 |
|
|
|
|
|
|
|