如何根据SSI中数据来自的表添加列?
我有两个源表:
- ext_agreements
- abs_agreements
都具有相同的列:“每个表都有不同的数据,这只是一个示例:“
ID, START_DATE, END_DATE,
01, 28/02/2021, 04/05/2021
02, 11/10/2021, 09/01/2022
03, 08/01/2022, 03/05/2022
我想将它们合并到目标数据库中的一个表中,同时通过维护协议类型的信息添加一个基于协议源表的“协议_TYPE”列“协议”或“ ABS”。
目的表将有:
ID, START_DATE, END_DATE, AGREEMENT_TYPE
01, 28/02/2021, 04/05/2021, ABS
02, 11/10/2021, 09/01/2022, EXT
03, 08/01/2022, 03/05/2022, ABS
我尝试了合并和联合所有和派生的列,但我没有成功。 谢谢
I have two source tables:
- Ext_Agreements
- ABS_Agreements
both have the same columns : "each table have different data this is just an example"
ID, START_DATE, END_DATE,
01, 28/02/2021, 04/05/2021
02, 11/10/2021, 09/01/2022
03, 08/01/2022, 03/05/2022
I want to merge them in one table in the destination Database, while maintaining the information of the type of the agreement by adding a columns "AGREEMENT_TYPE" that contain "Ext" or "ABS" based of the source table of the Agreement.
the destination table will have :
ID, START_DATE, END_DATE, AGREEMENT_TYPE
01, 28/02/2021, 04/05/2021, ABS
02, 11/10/2021, 09/01/2022, EXT
03, 08/01/2022, 03/05/2022, ABS
I tried merge and Union All and derived columns, but I didn't succeed.
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果要使用SSI,则...
在数据流中。
基于:
添加派生的列并添加:
对ABS(源和DER Col)进行相同的操作。
然后将它们放在联合车中。
If you want to use SSIS, then...
In data flow.
Create a source based on:
Add a derived column and add:
Do the same this for ABS (source and der col).
Then put them together in a UnionAll.
来源中的一个工会怎么样。
How about a UNION ALL in your source.