Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CA - AutoRefresh
Message
 
À
30/10/2004 03:39:46
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
00955384
Message ID:
01047162
Vues:
26
Hi Aleksey,

I'm doing some tests here and I find a problem.
If I have two tables T1 and T2, and the table T1 fires a trigger that inserts a new row in T2, when you try to recovery @@identity, you get a wrong number.
USE tempdb
GO
CREATE TABLE T1 (
   Z_id  int IDENTITY(1,1)PRIMARY KEY,
   Z_name varchar(20) NOT NULL)

INSERT T1
   VALUES ('Lisa')
INSERT T1
   VALUES ('Mike')
INSERT T1
   VALUES ('Carla')

CREATE TABLE T2 (
   Y_id  int IDENTITY(100,5)PRIMARY KEY,
   Y_name varchar(20) NULL)

INSERT T2 (Y_name)
   VALUES ('boathouse')
INSERT T2 (Y_name)
   VALUES ('rocks')
INSERT T2 (Y_name)
   VALUES ('elevator')

CREATE TRIGGER T1_trig
ON T1
FOR INSERT AS 
   BEGIN
   INSERT T2 VALUES ('')
   END
The properties below will set the fields
oCA.InsertCmdRefreshFieldList = "z_id"
oCA.InsertCmdRefreshCmd="SELECT @@IDENTITY"
When if you try it, you will get the wrong number (T2 identity).

Maybe I'm doing something wrong here...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Rodolfo Duarte
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform