SSIS For Each File Loop and File System Task to copy Files
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!
精彩评论