If you need to know the auto-generated identity value of the rows that has been added you could use the OUTPUT clause within your first INSERT statement together with the columns that will ligically uniquely identify each row. Then you can "re-use" the identiy value for the following insert statement(s).