I have two tables. One table (A) has n rows of data and the other table (B) is empty. I want to insert n rows into table B, 1 row for each row in table A. Table B will have a couple of fields from table A in it, including a foreign key from table A. In the end I want one row in B for each row in A. How can I write some TSQL to do this?
Share
Pinal Dave has wrote a great article on other alternative methods here:
http://blog.sqlauthority.com/2007/08/15/sql-server-insert-data-from-one-table-to-another-table-insert-into-select-select-into-table/