you can try to do this in one sp instead of another sp.
eg: insert into table1........
set @Table1Id = (select @@identity)
insert into table2 ..............values (@table1Id)-------------
and you can keep this sp in a tranaction like this,
begin transaction
declare @TotalErrors int
set @TotalErrors = 0
insert into table1........
set @TotalErrors = @TotalErrors + @@error
set @Table1Id = (select @@identity)
set @TotalErrors = @TotalErrors + @@error
insert into table2 ..............values (@table1Id)-------------
set @TotalErrors = @TotalErrors + @@error
if @@TotalErrors <> 0
begin
rollback
return
end
coMMit