Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 How do we identify which instance has locked a record?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-04-16 : 07:38:53
Magik writes "Hi,
We have set up a system which works on a 3 tier architecture -a terminal server, midas server and the SQL server(ver 8, sp 2). All have been set upin windows 2000. All users access the application through the terminal server. When a user accesses certain records we lock that particular one with the statement SELECT... WITH (ROWLOCK,UPDLOCK). So now when another user tries to access the same record, time out occurs and we trap it as 'Record Locked'. Is there anyway to identify which transaction has locked that particular record? We hav a table where all the user details are stored including the node from which the user has logged in. Shuld v do anythin with this table so as to facilitate the storage of that particular data?

Regards
Magik"

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-04-16 : 12:45:05
If you query syslocks, then that should give you what you want. Or if you want to do this on the fly, then just run sp_who (or sp_who2) to see who is blocking who.

Why are locking the record? SQL Server already protects it for you. Is there a business reason behind this?

Tara
Go to Top of Page
   

- Advertisement -