Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lock INSERT for record with specific values.
Message
De
12/06/2003 13:11:38
 
 
À
12/06/2003 09:25:04
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00799326
Message ID:
00799445
Vues:
21
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform