从 Excel 模板动态创建的 Excel 未正确写入数据-SSIS [英] Dynamically Created Excel From a Excel Template not writing Data Properly -SSIS

查看:34
本文介绍了从 Excel 模板动态创建的 Excel 未正确写入数据-SSIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个 SSIS 包,它将每天运行并将表的数据导出到目录中.Exported excel 有一个预定义的格式.所以我使用了模板excel.(Excel 仅带有 Column Headers 的文件)

I need to create a SSIS Package which will run daily and export a table's data into a directory. The Exported excel have a predefined format. So I have used a template excel. (Excel File with Column Headers only)

以下是我遵循的步骤:

  1. 创建了一个 variable 文件名,其中包含要生成的 excel 的位置和名称(基于当前日期值)

  1. Created a variable Filename with holds the location and name of the excel to be generated (based on current date value)

在控制流中添加了一个 File System 任务.将 Source 作为 Template Excel 和 Destination 作为 Filename 变量.

Added a File System Task in Control flow. Give Source as Template Excel and Destination as the Filename variable.

在控制流中添加了一个 Dataflow 任务并将其与文件系统任务连接.

Added a Dataflow Task in control flow and connect it with File System Task.

DataflowTask中,添加了一个OLE-DB source,并用source table配置(表数据需要复制到excel )

In Dataflow Task, added a OLE-DB source and configure it with the source table (the table data needs to be copied into the excel )

添加了 Excel 连接管理器 并将 Excel 文件路径 属性更改为 filename 变量.

Added a Excel Connection manager and changed Excel File path property to filename variable.

添加了 Excel Destination 并使用 Excel 连接管理器对其进行配置.

Data flow任务中设置Delayed validation true并执行包.

set Delayed validation true in Data flow task and Executed the package.

控制流:

数据流:

包运行成功,excel 文件也在所需目录中生成.但是 excel 文件在此之后跳过了大约 19000 行复制数据.为什么会这样?

The Package is running successfully and the excel file also get generated in the desired directory. But the excel file skips around 19000 rows copying data after that . why it is happening?

谁能帮我解决这个问题.

Can any one help me to solve the issue.

感谢您的帮助

推荐答案

有可能文件已经格式化了,底部的行往下...如果不删除,excel经常会跳转或添加行即使是空的行也已经使用了......我们还必须考虑奇怪的事件!

It is possible that the file is already formatted , and that lines are down at the bottom...often excel jumps or add lines if you do not delete the lines already used even if empty...we must also consider strange events!

这篇关于从 Excel 模板动态创建的 Excel 未正确写入数据-SSIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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