Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lock a record or a table?
Message
De
14/07/2016 10:09:38
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01638381
Message ID:
01638385
Vues:
52
>Hi,
>
>Do you know of a method to lock a row or a small table in SQL Server from VFP application? Such that if the connection handle is lost, after a while, the SQL Server releases the lock?
>
>TIA

In SQL Server, there's no simple easy method like there is in VFP (such as RLOCK(), FLOCK(), set exclusive on, etc.)

SQL Server has isolation levels - some of which perform locking (READ COMMITTED, REPEATABLE READ, SERIALIZABLE) and some that don't (SNAPSHOT...which uses row versioning instead)

SQL Server also has a SELECT WITH (UPDLOCK), but you have to be very careful on your indexing or you risk trying to lock more rows that you intended.

This sounds like a cliche', but it's important to understand your entire strategy (workflow-wise) when doing this in SQL Server.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform