06 December 2007

SQL Code - SOP Document Lock

Courtesy of Michael at MBSGuru, this script will tell you which users have a Sales Order Processing record locked. In other words, who's in using sales order processing or who has an orphaned record that is still locking a SOP transaction.
l.row_id,
t.dex_row_id,
t.SOPNUMBE,
a.USERID
from tempdb.dbo.Dex_Lock l
inner join SOP10100 t
on l.row_id = t.dex_row_id
inner join DYNAMICS.dbo.Activity a
on l.session_id = a.SQLSESID
Michael was kind enough to post this to the Newsgroup in response to a question and he's letting me share it here with the rest of you. I'll add it to the script downloads on the right as well.

Update: I had the wrong link for Michael's site. It's fixed now. Mea Culpa.