Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL record locking and transactions
Message
 
To
04/03/2004 12:05:23
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00874330
Message ID:
00883156
Views:
17
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform