Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to lock records in SQL Server
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00772304
Message ID:
00772342
Vues:
16
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform