I have a set of values in a variable table @vartable
id
34
235
34634
3643536
23
234
I then want to do the following insert -
insert into tableA
values ((select max(tableA_id)+1 from tableA), 2147, (select id from @vartable), 1, 0, 0)
So for each id in the @vartable it does an insert using the id on the row.
How do I go about this?
edit to note that I need to update the first value (select max(tableA_id)+1 from tableA) as increasing by 1 each new row it inserts.