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

Click here to load this message in the networking platform