I have 3 insert stored procedures each SP inserts data in 2 different tables
Table 1 Table 2 idPerson idProduct
Simply call test2 from test1 like:
test2
test1
EXEC test2 @newId, @prod, @desc;
Make sure to get @id using SCOPE_IDENTITY(), which gets the last identity value inserted into an identity column in the same scope:
@id
SELECT @newId = SCOPE_IDENTITY()