Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL record locking and transactions
Message
 
À
04/03/2004 12:05:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00874330
Message ID:
00883156
Vues:
18
I have found that using the UPDLOCK and ROWLOCK hints together never works. The smallest level of granularity I can achieve is (UPDLOCK, PAGLOCK). It appears that UPDLOCK just ignores ROWLOCK completely and locks the whole table.

>Open Query Analyzer
>
>- open two connections
>- select number 1, run this
>
>USE Northwind
>BEGIN TRAN
>SELECT * FROM dbo.Categories (UPDLOCK,ROWLOCK) WHERE CategoryID=3
>
>
>- select number 2, run this
>
>USE Northwind
>BEGIN TRAN
>SELECT * FROM dbo.Categories (UPDLOCK,ROWLOCK) WHERE CategoryID=3
>ROLLBACK
>
>You can see session 2 i locked
>
>- select number 1, run this
>
>ROLLBACK
>
>
>You can see session 2 continue
>
>Fabio
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform