Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locking a table row for one user
Message
From
28/08/2015 13:14:51
 
 
To
28/08/2015 05:13:03
Rob Clapworthy
Bespoke Software Systems
United Kingdom
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2014
Application:
Web
Miscellaneous
Thread ID:
01623931
Message ID:
01623950
Views:
54
>Any help extremely appreciated

Rob, sorry to jump in, but I have a question. Have you looked at the isolation level REPEATABLE READ?

Just wondering if that would accomplish the same thing. You can set the isolation level for the transaction to REPEATABLE READ. If the first SELECT is successful, then you should be able to issue the subsequent UPDATE statement in the transaction.

Also...you'll want to wrap this inside a TRY/CATCH block, in case you can't get a lock on the SELECT.

Not saying your initial code won't work (maybe a second question, if it's not working for you, what behavior were you getting?). Just curious if you had looked at the REPEATABLE READ isolation level.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform