I have setup a event to log deadlocks. I recognize that
But how can I find the row in question ?
asked 08 Jan '16, 05:23
As the record_id column within sa_report_deadlock() is declared as "The row ID of the associated row.", I would think the ROWID() system function will help. Here's a similar sample for the sa_locks() output:
SELECT * FROM sa_locks() S JOIN GROUPO.Employees WITH( NOLOCK ) ON ROWID( Employees ) = S.row_identifier WHERE S.table_name = 'Employees';
answered 08 Jan '16, 07:51
Here's a WAG: try ROWID() as in...
SELECT * FROM DBA.t WHERE ROWID ( t ) = [record_id value];
Caveat Emptor: I have not tried that particular logic with sa_report_deadlocks(), but Foxhound displays a similar query for you to use with the sa_locks() row_identifier column; see the Locked Row Query: field here...
answered 08 Jan '16, 07:58