Forum Moderators: open
Thanks
Cameron
The easiest way to do this is to use a stored procedure and use the @@IDENTITY system variable that picks up the value of last Identity generated
INSERT INTO tbl1(datafield) VALUES(@datafield1)
Set @tbl1ID = @@IDENTITY
INSERT INTO tbl2(tbl1id, datafield) VALUES(@tbl1ID, @datafield2)
There is a way to pick up the identity field on the client side but using stored procedures is good practice