Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CA - AutoRefresh
Message
De
06/09/2005 17:09:34
 
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:
01047166
Vues:
18
>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 SCOPE_IDENTITY()"




>
>
>When if you try it, you will get the wrong number (T2 identity).
>
>Maybe I'm doing something wrong here...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform