Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lock INSERT for record with specific values.
Message
From
12/06/2003 09:25:04
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Lock INSERT for record with specific values.
Miscellaneous
Thread ID:
00799326
Message ID:
00799326
Views:
61
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.
Next
Reply
Map
View

Click here to load this message in the networking platform