• Although this is a very nice way of getting extra info from the error log instead of just sending out a notification message, I do not understand why you create a fully qualified table in temdb instead of simply creating a temporary table in the session using the #tablename syntax. It would automatically create it in tempdb, as that is the way sql server works.

    Also I would put the syntaxt for the retrieval and sending of the email into a stored procedure and call the proc using the job. That way you can change the syntax and add, remove detail without the need of altering the job each time.

    finally, consider using the built in dynamic management views to augment your reporting such as:

    SELECT

    t1.resource_type,

    t1.resource_database_id,

    t1.resource_associated_entity_id,

    t1.request_mode,

    t1.request_session_id,

    t2.blocking_session_id

    FROM sys.dm_tran_locks as t1

    INNER JOIN sys.dm_os_waiting_tasks as t2

    ON t1.lock_owner_address = t2.resource_address;

    just my two pennies worth. But hey. Thanks for the trick with the custom job. I'll keep it in mind next time I tune a monitoring solution.