04 December, 2007

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 taught 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 s.SOPNUMBE, a.USERID
from tempdb.dbo.DEX_LOCK l
inner join DYNAMICS.dbo.ACTIVITY a
on l.session_id = a.SQLSESID
inner join SOP10100 s
on l.row_id = s.DEX_ROW_ID
and l.table_path_name = DB_NAME() + '.dbo.SOP10100'

No comments: