tsql - SSIS union all vs sql server Union All -


i use sql server 2012 , ssis. have 2 tables in same server , same database. need transfer records of both tables third table.

i need add columns (like execution id , package parameters) result of union , after have transfer records third table.

i have 2 solution doing don't know ones more efficient.

solution 1 : use 2 ole db datasources , use union component in ssis

enter image description here

solution 2 : use union all in sql server side , use 1 ole db source in ssis.

enter image description here

which 1 more efficient?

always favor database operations when possible. if 2 tables in same database, there absolutely no reason favor ssis operation on query optimizer. union no blocking operation, there no difference in case, if join or more complex operation query optimizer come play.

use database solution rule of thumb.


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -