简体   繁体   English

SSIS动态Excel目标不起作用

[英]SSIS dynamic Excel destination not working

I created a simple SSIS package to output an SQL table into an Excel file. 我创建了一个简单的SSIS包,以将SQL表输出到Excel文件中。 I gave the dynamic name to the Excel connection manager using the expressions and set the Delay validation to TRUE on entire package, Data Flow and Excel connection Manager. 我使用表达式将动态名称赋予Excel连接管理器,然后在整个程序包,数据流和Excel连接管理器上将Delay验证设置为TRUE。 I still get the validation error as below and when I open the Excel destination, it says, "no tables or views could be loaded". 我仍然收到如下所示的验证错误,当我打开Excel目标位置时,显示“无法加载任何表或视图”。

Excel connection Manager is looking for the dynamic file which is not yet created. Excel连接管理器正在寻找尚未创建的动态文件。

Error 1 Validation error. 错误1验证错误。 Data Flow Task: Data Flow Task: SSIS Error Code DTS_E_OLEDBERROR. 数据流任务:数据流任务:SSIS错误代码DTS_E_OLEDBERROR。 An OLE DB error has occurred. 发生OLE DB错误。 Error code: 0x80040E37. 错误代码:0x80040E37。 NewVendor.dtsx 0 0 NewVendor.dtsx 0 0

Error 2 Validation error. 错误2验证错误。 Data Flow Task: Data Flow Task: Opening a rowset for "Sheet1$" failed. 数据流任务:数据流任务:打开“ Sheet1 $”的行集失败。 Check that the object exists in the database. 检查对象是否存在于数据库中。 NewVendor.dtsx 0 0 NewVendor.dtsx 0 0

Are you using "Execute SQL task" to create the Excel file via a SQL statement? 您是否正在使用“执行SQL任务”通过SQL语句创建Excel文件? eg 例如

CREATE TABLE `Errors` (
    `item` NVARCHAR(255),
    `Key Data` NVARCHAR(255),
    `Create Date` NVARCHAR(255),
    `Modified Date` NVARCHAR(255),
   `Error Code` NVARCHAR(255),
   `Error Description` NVARCHAR(255)
)

If so then try running this on its own first to create some initial columns.This should be preceded by a File System Task to delete this file. 如果是这样,则尝试首先自己运行它以创建一些初始列。在此之前应先执行文件系统任务以删除该文件。

I would try setting the connection up non-dynamically, with an actual workbook that exists. 我将尝试使用存在的实际工作簿以非动态方式建立连接。 Then once this is working, add your expression to make it dynamic. 然后,一旦工作成功,添加您的表达式使其动态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM