I want to get all records from a table1 & insert them into table2. Table1 & table2 are in different databases, table1 and table2 are same structure.
Normally, I will get all records from table1, and for each record (foreach), I will insert it into table2 by using “INSERT …”. I want to know a effect way to insert all records into table only one time without foreach.
I use C#, .NET 2.0 & WinForm.
Thanks.
In SQL Code you can do a SELECT in the INSERT
Or if you are doing in Code then check out the SqlBulkCopy class