Discussion Locked

visual basic and sql

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

1. suppose i have to lock a set of records from vb ?how do i do it ?should i use xlock,rowlock or any other method is there?
2. how do i get the name of the user who has locked a particular record in multiuser environment?

2 replies

by 20 + years

Rowlock will provide you with greater user access without contention as the name implies it will only lock the current row and not the page. There should be a system table "syslocks" on most RDBMS that contains information on the lock, table and user. I will be honest with you, it is usually very hard to trace locking as locks generally remain for a very short time. In many cases sub-second. If you now that a row is locked because of extended waits or systems messages, the syslocks table should be able to help you.

This discussion is closed to new replies.