SSIS Excel Destination is Empty

可紊 提交于 2021-02-08 10:33:49

问题


I'm having an issue exporting a large dataset (500k+) to Excel via SSIS, where the output file ends up with 0 rows exported. Before saying that I shouldn't be exporting that many records to Excel, let me state that I know and normally wouldn't. Accounting does not want a CSV and is unwilling to open a CSV in Excel.

Using Visual Studio 2012 SSDT, here are the components involved.

  1. Execute SQL Task -> Creates the empty file with headers
  2. Data Flow Task ->
    • OLE DB Source -> SQL Query
    • Excel Destination

While the package is running, you can see records flowing from the source to the destination. The package completes without error, but when you open the file, it's empty. The only thing in there is the header.

If I select the Top 1000 records and export to Excel, it works as intended.

Some things I've tried:

  1. Export to Excel on the network
  2. Export to Excel locally
  3. Export to CSV to Excel on both network and locally
  4. Export to Ole DB Destination using Office Access Database Engine 12.0 with "Excel 12.0" extended properties.
  5. Tried running as different users

All with the same outcome.

Can anyone provide any insight into why this may be happening and how to proceed?


回答1:


We experienced a similar behaviour, when runnig the ETL in a SQL Server Agent job. Debugging it in Visual Studio, worked, however. So I do not know, whether this solution applies to you.

The reason was that the user, under which the package ran, did not have access to C:\users\Default.

I found this out by using sysinternals process monitor.

I was inspired by that post: Empty Excel File permissions issue: SSIS Excel Destination buffers large record sets through C:\Users\Default

[I explained my search for the bug in my blog: https://www.csopro.de/biblog/2018/04/ssis-fehlerbehebung-bei-excel-destination-schreibt-keine-zeilen/ Unfortunately it is in German]



来源:https://stackoverflow.com/questions/48756399/ssis-excel-destination-is-empty

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!