Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to lock records in SQL Server
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00772304
Message ID:
00772342
Views:
15
SQL Server doesn't have a mechanism for doing pessimistic locking. You'll have to implement something yourself. A common method is to set a flag on the row or have a seperate table that contains the ID of the rows that should be considered locked.

Now there are ways to do what you want but they're not recommended. You can set your transaction isolation level to REPEATABLE READ and do a SELECT on the row first. You could also use a lock hint and get the same effect. The downside is that you'll have to start a transaction and hold the transaction through the life of the edit - not a good idea IMO. You can affect the concurrency of your application greatly.


-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform