SSIS-导入Excel文件时记录行号

SSIS导入Excel时记录行号

1. "Excel源"后添加"脚本组件"

2. "脚本组件"中新增输出列,命名为"RowNumber"

3. "脚本组件"中编辑脚本.

4. 脚本如下.

private
				int m_rowNumber;

 

       m_rowNumber++;

       Row.RowNumber = m_rowNumber;

5. 下一步的输入列中显示RowNumber

6. 结果.

   

参考链接:

1. https://support.microsoft.com/en-us/help/908460/how-to-add-an-incremental-counter-in-a-sql-server-2005-integration-ser

2. https://www.hansmichiels.com/2015/11/13/how-to-add-a-rownumber-to-a-data-flow-task-in-ssis-2012/

posted on 2019-01-22 21:52  天空一角  阅读(935)  评论(0编辑  收藏  举报