Posts

Showing posts from October, 2015

SQL Server – T-SQL Script to detect blocking & block chain(s) and send alerts for it with detailed report

Today I’ll share a script, which I believe most of us will find very useful for their environment just like me. Blocking is very common event on a database server and in-fact blocking occurs almost all the time and fortunately most of them are not harmful (enough). But as we all know this normal occurring event can sometime cause huge issues and we should have some mechanism to track these harmful ones. Generally without third party assistance it is bit difficult to actually isolate blocking, which can be potentially harmful right now or in future and the default alerting options can flood inbox with too many mail alerts suppressing the one's which are relevant. Fortunately I’m able to ease the things a bit and was able to find a T-SQL way to track and send report of potential problem causing blocking and block chain processes and that too without flooding inbox with non-relevant alerts. -- ============================================= USE [master] GO SET AN