• This is awesome. I made one small change that others may find useful. Preceding the order by statement, I added the following where clause line to filter out the sp_who3 process. Change the name of the process, "dbo.sp_who3" in this case, to whatever yours shows up as. This varies depending on where you placed the stored procedure.

    where qt.objectid <> OBJECT_ID('dbo.sp_who3')

    ORDER BY

    er.blocking_session_id DESC,

    er.logical_reads + er.reads DESC,

    er.session_id

    END