开发者

SSIS For Each File Loop and File System Task to copy Files

开发者 https://www.devze.com 2022-12-28 18:44 出处:网络
I\'m using a files system task inside a for each loop container, just as described here: li开发者_开发知识库nk text

I'm using a files system task inside a for each loop container, just as described here: li开发者_开发知识库nk text

However, when I execute the package I get this error: [File System Task] Error: An error occurred with the following error message: "The process cannot access the file 'C:\Book1.xlsx' because it is being used by another process.".

I do not have the file open, and I assume no one else does, as I am able to copy, and open, and overwrite the file.

Any suggestions would be appreciated. If you want an example package plz let me know.


I've figured out the problem. Be sure to not create File connections(you can see them in the Connection Managers tab) that hold on to the same variable as the path you are using for the source file, in the File System Task.


Since this took me MANY HOURS to solve, I'm posting my solution for others. And it was sooo simple...

Place a copy of your Excel File in another folder and name it "template.xlsx". Have your Schema connection point to this copy. The actual Excel file will no longer be kept locked by the ForEach Worksheet Schema loop!

0

精彩评论

暂无评论...
验证码 换一张
取 消