10/14/09

Who has that record locked?

I love the GP Newsgroup. Helping others with their problems helps me learn more about GP. Here's what I tought myself today in response to a newsgroup post.

Run this against your company database to select the users which users have SOP Documents locked:

select distinct 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
where right(rtrim(table_path_name), 8) = 'SOP10100'

http://mbsguru.blogspot.com/2007/12/who-has-that-record-locked.html

No comments: