如何在SSIS中实现动态源目标头映射 [英] How to achive dynamic source destination header mapping in SSIS
问题描述
任何人都可以帮我解决以下问题......
------------------------------ -------------------------------------------------- ---------------
来源txt文件可能采用以下格式
----------- ----------------------
案例1
- ------------
CName |潘|手机
A | PANA1 | 1234567891
B | PANB2 | 1234567892
案例2
------------
Pan_No | Mobile_No |客户名称|性别
PANA1 | 1234567891 | A | M
PANB2 | 1234567892 | B | F $ / $
案例3
------------
电子邮件| Mobile_Number | Customer_Name | PanNumber
A@gmail.com | 1234567891 | A | PANA1
B@gmail.com | 1234567892 | B | PANB2
目的地表
--------------- ---------------------------
客户表
----- -----------
C_Name | C_PanNo | C_MobileNo
A | PANA1 | 1234567891
B | PANB2 | 1234567892
ExternalHeaderMapping表
----------------------- ------------------
Id DestinationColumnName ExternalHeaderName
1 C_Name CName
2 C_Name客户名号
3 C_Name Customer_Name
3 C_PanNo Pan
4 C_PanNo Pan_No
5 C_PanNo PanNumber
6 C_MobileNo手机
7 C_MobileNo Mobile_No
8 C_MobileNo Mobile_Number
在上面的例子中,我需要构建一个SSIS包,它应该适用于以上三种情况,甚至
列的顺序被更改并且新列被添加。
在案例2和案例3中,它应该忽略性别和电子邮件列。
我是SS新手是的,请帮助我如何用SSIS实现同样的效果..我知道它只能通过脚本组件实现但是
不知道怎么办....
Can any one help me on below implementation…
-----------------------------------------------------------------------------------------------
Source txt File may come in below format
---------------------------------
Case-1
-------------
CName | Pan | Mobile
A | PANA1 | 1234567891
B | PANB2 | 1234567892
Case-2
------------
Pan_No | Mobile_No | CustomerName | Gender
PANA1 | 1234567891 | A | M
PANB2 | 1234567892 | B | F
Case-3
------------
Email | Mobile_Number | Customer_Name | PanNumber
A@gmail.com | 1234567891 | A | PANA1
B@gmail.com | 1234567892 | B | PANB2
Destination Table
------------------------------------------
Customer Table
----------------
C_Name | C_PanNo | C_MobileNo
A | PANA1 | 1234567891
B | PANB2 | 1234567892
ExternalHeaderMapping Table
-----------------------------------------
Id DestinationColumnName ExternalHeaderName
1 C_Name CName
2 C_Name CustomerName
3 C_Name Customer_Name
3 C_PanNo Pan
4 C_PanNo Pan_No
5 C_PanNo PanNumber
6 C_MobileNo Mobile
7 C_MobileNo Mobile_No
8 C_MobileNo Mobile_Number
In the above case I need to build the SSIS packge it should work for all the above three case even
the order of column is changed and new column being added.
In case-2 & Case-3 it should ignore the Gender and Email column.
I am new to SSIS, please help me how to achive the same with SSIS..I know it can only achive through Script component but
don't know how to do....
推荐答案
这篇关于如何在SSIS中实现动态源目标头映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!