如何跳过 SSIS 数据流中的最后一行 [英] How to skip last row in the SSIS data flow

查看:39
本文介绍了如何跳过 SSIS 数据流中的最后一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的数据流中使用 FlatFile Source Manager --> Script COMponent as Trans --> OLEDB destination.

I am using FlatFile Source Manager --> Script COmponent as Trans --> OLEDB destination in my data flow.

Source 从平面文件中读取所有行,我想跳过更新数据库的最后一行(Trailer 记录).

Source reads all the rows from flat file and i want to skip the last row (Trailer record) updating the database.

因为它包含 NULL 值,数据库抛出错误.

Since it contains the NULL values, database throws error.

请帮我解决这个问题.

问候,VHK

推荐答案

如果您的要求是避免平面文件中的行具有空值,那么您可以遵循以下方法,

If your requirement is to avoid rows having null values in the flat file then you can follow below approach,

  • 使用源组件从平面文件中读取数据.
  • 使用 Conditional Split 组件,并在 case 表达式 中提供为 !ISNULL(Column1) &&!ISNULL(Column2) (Column1 和 Column2 可以随心所欲.如果您的平面文件有一列名为 ID 并且它除了最后一行之外没有空值,然后你可以使用 !ISNULL(ID)).
  • 将案例输出映射到 OLEDB 目标.
  • Read data from flat file using source component.
  • Use Conditional Split component, and in the case expression provide as !ISNULL(Column1) && !ISNULL(Column2) (Column1 and Column2 can be as your wish. If your flat file has a column named, say ID and it does not have null value except the last row, then you can use as !ISNULL(ID)).
  • Map the case output to the OLEDB destination.

希望对你有很大帮助.

这篇关于如何跳过 SSIS 数据流中的最后一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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