Empty Excel File permissions issue: SSIS Excel Destination buffers large record sets through C:\Users\Default

StackOverflow https://stackoverflow.com/questions/23523953

質問

An SSIS package is invoked via DTEXEC.EXE from a web application. The package uses a File System Task to make a copy of an Excel template file to be used as the Excel destination file. A Data Flow Task then sends records from an OLE DB Source into the Excel Destination. The Excel destination file is then streamed back to the web application user's browser.

This works fine when the web application pool identity is a local admin account. It also works when the web application pool identity is a limited user who happens to be interactively logged in as well.

When the web application pool identity is a limited user who is NOT concurrently logged in, a problem is encountered. Small Excel files (a few hundred rows) are still returned correctly. No problem there. Large Excel files (a few ten thousand rows) are returned empty. There are no rows in the streamed file that is returned to the user's browser. The destination file that is written on the server is also empty.

The SSIS package does not see an error, and reports that tens of thousands of records passed through the Data Flow. This is not a permissions issue on the SQL Server side. When the user account is given SQL Server sysadmin, it still fails to write any rows to a larger Excel destination file.

This looks like a permissions problem on the Windows side, perhaps involving a buffer being written to disk, which is why the problem does not occur when only a few hundred rows are processed.

It was hoped that disk buffering could be avoided by increasing the Data Flow Task settings for DefaultBufferMaxRows (10,000 rows) and DefaultBufferSize (10 MB). However, unfortunately this does not work.

This is a solved problem that is posted to assist anyone who may encounter a similar problem.

役に立ちましたか?

解決

Using Process Monitor reveals that ISServerExec.exe is trying to save a buffer to C:\Users\Default\AppData\Local\Microsoft\Windows\Temporary Internet Files. When the limited user account is given access and permissions under C:\Users\Default, everything works.

This explains why an interactively logged-in user or a local admin account was able to write Data Flow records to the Excel file, but a regular batch login was not able to do so. This is an undesirable behavior of the SSIS Excel Destination.

他のヒント

SSIS package works fine in BIDS for loading excel file with more than 5000 rows but failed when same package runs in SQL server Agent Job under proxy account. Main cause of this is that for large file SSIS process use C:\Users\Default location to buffer data. So Proxy account needs write access on this folder location. Package works fine in JOB too after this…

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top