There may end up being more or less than 10, but it’s a good biblical title, so we’ll try.
- Thou shalt not use the
sa
login.- If you need
sysadmin
rights, create a new account, rename the default, and/or use Windows auth.
- If you need
- Thou shalt always have a
rollback
plan for production changes. - Thou shalt NAME thy entities, objects, and relationships. MEANINGFULLY.
- Thou shalt not, in good conscience, use white-space or language-reserved characters in thy entity/object names.
- Thou shalt not use deprecated syntax or features, if at all possible.
- Thou shalt not use
with (nolock)
hints throughout your stored procedures. - Thou shalt not use the
between
comparison operator withdate/time
datatypes.- Use greater-than-or-equal, and less-than, like so:
@MyDate >= @StartDate and @MyDate < @EndDate
, where@EndDate
is the day after the last possible day you want to include. It sounds more confusing than it really is. You want the month of April 2017? That’s just@MyDate >= '20170401' and @MyDate < '20170501'
. Simple.
- Use greater-than-or-equal, and less-than, like so:
- Thou shalt COMMENT. ALWAYS. At least on all “programmable” objects (stored procs, functions, triggers, views, user-defined types, etc.)
- Thou shalt not run the default MS built-in maintenance plans. For the love of all things holy.
- Thou shalt not RDP into your SQL server just to run SSMS. Set up your server correctly with remote connections & TCP/IP connectivity, and don’t touch it again.
- Thou shalt always share a beer with thy comrades after a long hard day of after-hours troubleshooting and/or production outages. And if any are not present because they’re STILL on pager-duty, thou shalt raise thy flagons high and toast to their honor, for they shall be remembered unto the end of days.
That’s all I have for now… feel free to comment, suggest additions or changes, and send any hate-mail to my contact page!