Link to home
Create AccountLog 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
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of TheCommunicator

ASKER

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