什么是最有效的方式来执行下面的SQL"伪代码"(在存储过程):
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)
它需要使用"SqlDataReader对象"(如在C#中)在存储过程本身?
无论如何,我怎么能执行正确吗?