Hi-
I have an ASP.NET form (VB) that on submittal does a 3 part insert. It runs 3 stored procedures, the first of which creates a record of the majority of the data. What I want is the simplest, most accurate way to return the ID (incremented primary key from the first insert), so that I can use it in the next 2 inserts. All I can think of doing is
'call sproc1
'do a select max(ID) from table1
'call sproc2 and 3 with that ID as an added arg
i know the chance is slim that i would get the wrong ID back, but its possible, and there just seems like there should be a better way.
any ideas?
THanks!
I have an ASP.NET form (VB) that on submittal does a 3 part insert. It runs 3 stored procedures, the first of which creates a record of the majority of the data. What I want is the simplest, most accurate way to return the ID (incremented primary key from the first insert), so that I can use it in the next 2 inserts. All I can think of doing is
'call sproc1
'do a select max(ID) from table1
'call sproc2 and 3 with that ID as an added arg
i know the chance is slim that i would get the wrong ID back, but its possible, and there just seems like there should be a better way.
any ideas?
THanks!