简体   繁体   English

数据流任务成功执行但未将任何行写入 Excel 文件

[英]Data flow task executing successfully but not writing any rows to Excel file

I am working on SSIS package that is fetching data from SQL server and inserting into Excel file... in Data Flow Task i've used OLE Db source and Excel destination .我正在处理从 SQL 服务器获取数据并插入 Excel 文件的 SSIS 包...在数据流任务中,我使用了OLE Db 源Excel 目标

After configuring OLE Db source i can preview the resulting row and even data flow task executing successfully without giving any error.. but not inserting any row..配置 OLE Db 源后,我可以预览结果行,甚至可以成功执行数据流任务而不会出现任何错误.. 但不插入任何行..

Well fortunately i found the answer,I did two things..幸运的是我找到了答案,我做了两件事..

  1. I just deleted the old Data Flow Task on which i have tried so many different settings and parameters... and Build the Data Flow Task all over again...我刚刚删除了我尝试过很多不同设置和参数的旧数据流任务......并重新构建数据流任务......

  2. In SQL query i'd wrote the Fully qualified name instead of 'Use Database' Statement.在 SQL 查询中,我写了完全限定名称而不是“使用数据库”语句。

Hope this will help someone..希望这会帮助某人..

Have you tried writing to a flat (text) file first to be certain that data's coming out of your data flow task and going into the results?您是否尝试首先写入平面(文本)文件以确保数据从您的数据流任务中流出并进入结果?

Be absolutely sure that you've mapped the columns from the source to the target as well.绝对确保您也已将列从源映射到目标。

Here's a clear explanation what's going on.这是发生了什么的清楚解释。 Most likely, you are using table variable... SSIS OLE DB Source Using Table Variables Returns No Rows最有可能的是,您正在使用表变量... SSIS OLE DB Source Using Table Variables Returns No Rows

My issue was a print statement in the SQL command.我的问题是 SQL 命令中的打印语句。 I commented it out and it worked.我把它注释掉了,它奏效了。 The preview worked with the print statement in there.预览与那里的打印语句一起使用。 Tricky...棘手...

I already had SSIS package that was running well and writing to file properly.我已经有了运行良好并正确写入文件的 SSIS 包。 I changed the query and it stopped writing anything in text file even though i have records which i can see in preview.我更改了查询,它停止在文本文件中写入任何内容,即使我有可以在预览中看到的记录。 Solution : Sometimes you have query that has USE database command before the query begins.. remove that command and it will work.解决方案:有时您的查询在查询开始之前具有 USE database 命令。删除该命令,它将起作用。 Hope it helps someone.希望它可以帮助某人。 Cheers.干杯。

I needed to choose the Connection Manager node in my Data Flow Task and set the ConnectionString property with the name of the file I wished to create;我需要在我的数据流任务中选择Connection Manager节点,并使用我希望创建的文件的名称设置ConnectionString属性; without this field filled out, no file appeared.如果不填写此字段,则不会出现任何文件。

I find if I reopen my script component and select "run code analysis" it does a slower 'rebuild all' (Visual studio 2017) which 'wakes it up' again and then the rows are processed.我发现如果我重新打开我的脚本组件并选择“运行代码分析”,它会执行较慢的“全部重建”(Visual Studio 2017),它会再次“唤醒它”,然后处理行。 Overall though SSIS/VS 2017 is a nightmare with memory errors, crashes which wipe out the whole csproj and folder structure.总的来说,尽管 SSIS/VS 2017 是一个带有内存错误的噩梦,崩溃会导致整个 csproj 和文件夹结构消失。 I have had to recreate the project dozens of times.我不得不重新创建该项目数十次。

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

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