使用SSIS的LOGIC(脚本组件) [英] LOGIC using SSIS (script component)

查看:123
本文介绍了使用SSIS的LOGIC(脚本组件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在执行一项任务,该任务需要应用一些业务逻辑后才能将数据从文本文件传输到目标.

以下是我的文本文件数据


employee_id 薪金
10 1000
20 2000
30 3000
40 5000


我需要在其上再添加一个列,称为"pre_row_salary",该列将是根据上表在上述索引中的员工工资.
请查看下表以了解更多信息.第一行在"pre_row_salary"列中包含NULL,因为上方没有一个.第二行在"pre_row_salary"中包含1000,这是雇员10的薪水.第三行在"pre_row_salary"中包含2000.员工工资20(上级).


桌子>
让我知道如何使用此业务逻辑将此文本文件数据处理到目的地.

解决方案

请参阅此网站,您将发现您的要求... http://www.sqlservercentral.com/Forums/Topic627016-298-3.aspx#bm632634 [ ^ ]

您可以使用脚本组件,添加一个名为pre_row_salary的新输出列. 然后编辑脚本以循环所有记录,并在方法ProcessInputRow中设置pre_row_salary.

希望对您有帮助.


Hi everyone,

I am working on one task which need to transfer data from text file to destination after applying some business logic.

Below is my text file data


employee_id 工资 pre_row_salary
10 1000
20 2000 1000
30 3000 2000
40 5000 3000
employee_id salary
10 1000
20 2000
30 3000
40 5000


I need to add one more column to it called as "pre_row_salary" which will be salary of employee in above index as per above table.
Look below table for more information.First row contain NULL in "pre_row_salary" column because there is no-one above it.Second row contain 1000 in "pre_row_salary" which is salary of employee 10. Third row contain 2000 in "pre_row_salary" which is salary of employee 20(Upper rank).


employee_id salary pre_row_salary
10 1000 Null
20 2000 1000
30 3000 2000
40 5000 3000

Let me know how can I process this text file data with this business logic to the destination.

解决方案

refer this website you will find out you requirements... http://www.sqlservercentral.com/Forums/Topic627016-298-3.aspx#bm632634[^]


You can use Script Component, add a new output column named pre_row_salary.
Then edit script to loop all record, set pre_row_salary in method ProcessInputRow.

Hope this will help you.


这篇关于使用SSIS的LOGIC(脚本组件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆