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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…