Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

How to remove one single rowlock

$
0
0

Is it possible to remove one single rowlock?

For example
BEGIN TRANSACTION
1) SELECT * FROM [Table] WITH (XLOCK, NOWAIT, ROWLOCK) WHERE [Id]=1
2) SELECT * FROM [Table] WITH (XLOCK, NOWAIT, ROWLOCK) WHERE [Id]=2

How can Release lock on row with ID 1.
I work with sqlconnection from VB.NET.
When using rollback/commit the lock on row with ID 2 will be released also.


Viewing all articles
Browse latest Browse all 8428

Trending Articles