Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
266 views
in Technique[技术] by (71.8m points)

c# - Empty Excel File permissions issue: SSIS Excel Destination buffers large record sets through C:UsersDefault

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Using Process Monitor reveals that ISServerExec.exe is trying to save a buffer to C:UsersDefaultAppDataLocalMicrosoftWindowsTemporary Internet Files. When the limited user account is given access and permissions under C:UsersDefault, 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...