且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何跳过 SSIS 数据流中的最后一行

更新时间:2021-09-28 01:40:44

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

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.

希望对你有很大帮助.