Is it possible to find out which user has a ROWLOCK on a table?
Posted: Wed 14 Apr 2021 03:53
i am trying to determine which user has a record locked in 'edit' mode.
In Rad Studio (Delphi) before i try and change a ROW value i use this code:
try
tCustomer.Edit;
except on E: EDAError do
begin
if e.ErrorCode = 1205 then Showmessage('Record in Use');
end;
This part works flawlessly as the TMyTable or TMyQuery returns the 1205 error code indicating the current record/row is locked by another user. But if that user has walked away from their desk to go to lunch or if they're on the phone i want the second user who needs to get access to the record to at least know WHICH user has the record locked.
Is something like this possible?
I know you can query CONNECTION_ID() or CURRENT_USER() but that is for the current client. I need a way to get at which CONNECTION_id or User OR wINDOWS LOGIN ACCOUNT is is.
Thanks in advance.
In Rad Studio (Delphi) before i try and change a ROW value i use this code:
try
tCustomer.Edit;
except on E: EDAError do
begin
if e.ErrorCode = 1205 then Showmessage('Record in Use');
end;
This part works flawlessly as the TMyTable or TMyQuery returns the 1205 error code indicating the current record/row is locked by another user. But if that user has walked away from their desk to go to lunch or if they're on the phone i want the second user who needs to get access to the record to at least know WHICH user has the record locked.
Is something like this possible?
I know you can query CONNECTION_ID() or CURRENT_USER() but that is for the current client. I need a way to get at which CONNECTION_id or User OR wINDOWS LOGIN ACCOUNT is is.
Thanks in advance.