Not sure I've articulated that well in the title, so here goes...
I have three tables
|10||some row data|
|11||some more row data|
|1||my old data|
|2||and more data|
GlobalID (with a single row numeric field)
I'd like to use a Insert Into Select like below:
INSERT INTO table1 ( ID ,NewNames ) SELECT 'a new id' ,OldNames FROM table2
'a new id' is a numeric value and should equal the (max value + 1) from the GlobalID table.
My problem is I obviously need to keep adjusting the GlobalID table and increase the max for each row as I'm inserting from the Select!
Does that make sense?
Any help appreciated. Using sql server 2016 if that makes any difference. Les