Microsoft SQL Server

MSSQL Traceflags — Deadlocks

SQL 2005, You can enable trace­flags to allow MSSQL Serv­er pro­duce more verb­ose inform­a­tion to error­log. Trace flag 1222 Trace flag 1204

MSSQL DMVs — Blockings

This is a very good DMV script that gives you blocking/​​locking even on page level and the SQL state­ment each spid is run­ning at the time.   SELECT tl.request_session_id AS Wait­ing­Ses­sionID ‚wt.blocking_session_id AS Block­ing­Ses­sionID ‚wt.resource_description ‚wt.wait_type ‚wt.wait_duration_ms ‚DB_NAME(tl.resource_database_id) AS Data­base­Name ‚tl.resource_associated_entity_id AS Waitin­gAs­so­ci­atedEn­tity ‚tl.resource_type AS Wait­in­gRe­source­Type ‚tl.request_type AS Wait­in­gRe­quest­Type ‚wrt.[text] AS Wait­ingT­Sql ‚btl.request_type Block­in­gRe­quest­Type ‚brt.[text] AS […]