Handling SQL Server Deadlocks With Event Notifications

2017-06-29 1 Comments

Dave Mason - Event Notifications - SQL Server Deadlock

I've seen a few different methods for handling deadlocks in SQL Server. I don't notice the use of event notifications very often, so I thought I'd share my approach. For my purposes, I want SQL to notify me when a deadlock occurs. I also want an easily accessible deadlock graph that I can inspect and potentially pass along to development or software vendors.


Undocumented T-SQL Commands

2017-06-14 0 Comments

I recently encountered code similar to this in production:

IF (NOT IS_MEMBER('db_accessadmin') = 1) AND
 (NOT IS_MEMBER('db_owner') = 1)
 DBCC AUDITEVENT (109, 1, 0, N'<loginName>', N'<dbUserName>', NULL, NULL, NULL, NULL, NULL)


Database Corruption: Incorrect PFS Free Space

2017-06-08 0 Comments

Dave Mason - SQL Server - DBCC CHECKDB

I've been lucky with database corruption during my career. I could probably count on one hand the number of times I've had to deal with it. A couple times, it was in a customer's environment--they managed it themselves, but called me in to help. The other incidents were ones I inherited from a backup I had to restore into a production environment. The first time it happened to me, I didn't realize it until days later when DBCC CHECKDB ran during a weekend maintenance window. After that, I added a new "rule" to my list: always run DBCC CHECKDB after restoring a database from someone else. That rule paid dividends today.


The Ambiguity Of Acronyms

2017-06-03 0 Comments

Today I feel the need to blog my thoughts about something I've realized for a long time: we suck at acronyms. And by "we", I mean journalists, bloggers, and other online content providers. In particular, in the online realm, this is a needless problem that is easily remedied. More on this in a bit.