SELECT PKEY_ID_COLUMN FROM table1 -- SELECT all the ID values from table1... (lets say 1,2,3) -- Now, insert to another table the value 1 (for example...) along with each and every one of the values from the previous query. INSERT (1,1), (1,2), (1,3) INSERT INTO relational_table (ID1,table1ID) VALUES(1,PKEY_ID_COLUMN)
insert into ... select
insert into table1 (id1, table1id) select id as [id1], column as [table1id] from table2
INSERT INTO relational_table (ID1,table1ID) SELECT 1, PKEY_ID_COLUMN FROM table1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)