hello , my variable @@identity increases by it self ! could you tell me what's wrong with my code. thanks.
INSERT INTO table1(aa,bb)VALUES (@aa,@bb)
select @VarID = @@IDENTITY
INSERT INTO table2(cc,dd) VALUES (@@IDENTITY, @dd)
or
INSERT INTO table2(cc,dd) VALUES (@VarID , @dd)
does not give me the last autoincrement number that has been generated in table1.
how can i hold on that value ?
thanks
INSERT INTO table1(aa,bb)VALUES (@aa,@bb)
select @VarID = @@IDENTITY
INSERT INTO table2(cc,dd) VALUES (@@IDENTITY, @dd)
or
INSERT INTO table2(cc,dd) VALUES (@VarID , @dd)
does not give me the last autoincrement number that has been generated in table1.
how can i hold on that value ?
thanks