View Single Post

   
  #3 (permalink)  
Old 02-29-2008, 05:52 AM
Dan Guzman
 
Posts: n/a
Default Re: Determine which user has locked a record

You can get to the table and index level by using the objid and indid.
However, many lock resources are actually hashed values so you'll have
difficulty identifying a specific row.

However, the need to do this sort of thing in application code may be a
larger design issue. Pessimistic locking is bad for both performance and
concurrency. It is best to avoid open transactions when waiting for user
input because users may get interrupted or go to lunch. This can lead to
serious blocking issues.


--
Hope this helps.

Dan Guzman
SQL Server MVP

"David C. Barber" <david@NOSPAMdbarber.com> wrote in message
news:4e-dnSflzfmbF2HcRVn-pA@comcast.com...
> I'm trying to determine which user has locked a given record from VB6.
>
> I know I can use sp_lock and sp_who, and match up the data to determine
> which users have locked records in my database, however I haven't seen a
> way
> to match the specific user to the specific record. What am I missing
> here?
>
> Thanks!
>
> *David*
>
>



Reply With Quote