Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lock INSERT for record with specific values.
Message
From
12/06/2003 13:11:38
 
 
To
12/06/2003 09:25:04
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00799326
Message ID:
00799445
Views:
22
I'm confused. Do you want to insert a record and then acquire a row lock on it and hold it for a length of time? Why? This could (and probably will) affect your concurrency.

-Mike


>Hi,
>
>
>-- example table
>CREATE TABLE dbo.test
>(
>   id int IDENTITY (1, 1) NOT NULL
>  ,Tx char(10) NOT NULL
>  ,Gruppo tinyint NOT NULL
>)
>
>INSERT INTO dbo.test VALUES ('a',1)
>INSERT INTO dbo.test VALUES ('B',1)
>INSERT INTO dbo.test VALUES ('C',1)
>INSERT INTO dbo.test VALUES ('az',2)
>INSERT INTO dbo.test VALUES ('Bz',2)
>INSERT INTO dbo.test VALUES ('Cz',2)
>
>
>I need this:
>- lock dbo.test for INSERT from other session
>- allow SELECT from other session ( UNLOCK or READPAST )
>
>I have resolve this.
>
>I need this:
>- lock dbo.test for INSERT from other session
> only for INSERT with Gruppo=1
>- allow SELECT from other session ( UNLOCK or READPAST )
>
>Example:
>if on another session is execute:
>INSERT INTO dbo.test VALUES ('asdasd',2)
>this command insert VALUES ('Cz',2) and can continue without problem;
>
>if on another session is execute:
>INSERT INTO dbo.test VALUES ('asdasd',1)
>this command is locked and wait lock release.
>
>I can do it on Microsoft SQL ?
>
>On Oracle or DB2 a can do it ?
>
>Fabio
>
>
>I have resolve this.
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform