• Adam Thurgar

Enable deadlock alerting

One of the difficulties in dealing with deadlocks is actually knowing that they occurred and then getting information. Even if you have enable the right trace flags, you are only part of the way there. The 1205 deadlock message is not logged and this means that it could be missed. So you need to log this message by

EXEC master..sp_altermessage 1205, 'WITH_LOG', true;

Then you can add an alert for message_id 1205.

With this alert I then call the SQL Server Agent job for sp_whoisactive (to a logging table) to catch what is happening at the time the 1205 alert happened. Then use the the system_health extended events for the xml_deadlock_report.


Recent Posts

See All

Cardinality estimator

Recently I was asked by a software vendor to review a particular query that ran in under a second on a SQL Server 2014 installation at a compatibility level of 110 (SQL Server 2012), but when run unde

Index fragmentation

A law firm client, occasionally has issues with their legal software, that is provided by the global leader in this field. The response from the software provider is always the same - you have index f

Deleting large amounts of data

I had a client call me about wanting to delete a large amount of data from their database. They knew what tables they wanted to delete from. They also knew that deleting large amounts of data causes t