What is the best way to pump data into different tables using stored procedure? Assume I have around 1 million rows each in 3 different tables say A,B,C. Now based on some criteria I have to club data from these 3 and push it into another table say D. What is the optimized way to do this?
I need to add some business logic before inserting the data.