Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

How to use dynamic SQL to insert into a dynamic target table

$
0
0

Hi All,

Using SSIS Package, I want to insert into a table, where my source and target tables have dynamic col names. Also these source and target are from two different servers. Explained the scenario below.

For ex: I have TblA from ServerA & TblB from ServerB. SchemaName: Y2017.

Sample TblA columns: Event,NUM,APAmt,CBAmt17,GrosAmt17

Sample TblB columns: Event,Num,APAmt,CBAmt17,GrosAmt17.

As mentioned above, last two character of schema name would be placed in some of the columns in tbla and tblb.

Since the column names are dynamic, I will create a dynamic sql like,  insert into tblb ...  select ... from tbla.

Since my two tables are from two different servers. How can I achieve this select & inserting in SSIS.

Kindly let me know.


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>