Link to home
Start Free TrialLog in
Avatar of TheCommunicator
TheCommunicatorFlag for United States of America

asked on

row level locking on sql server

Hello people,

here is the scenario: We have a message queue and we are processing that queue in multiple threads. Now each thread will take 25 email addresses from a particular table and then process it. So we are looking for a mechanism which actually provides us facility to lock a particular row in the table, once thread has picked it up for processing. We thought about setting a bit manually but select statement on TOP(25) and then update on the same row would be very time consuming in a sense what if another thread comes in  and picks up the thread.

Any suggestions?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Brendt Hess
Brendt Hess
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TheCommunicator

ASKER

Thank you so much guys. The information that you guys gave was helpful:)