The process cannot access the file because it is being used by another process.
Error: 0xC002F304 at Rename file 1, File System Task: An error occurred with the following error message: "The process cannot access the file because it is being used by another process.".
When running two File System Tasks after each other, with the same file, the file is still locked when running the second task. Resulting in an error: 0xC002F304 at Rename file 1, File System Task: An error occurred with the following error message: "The process cannot access the file because it is being used by another process.".
I found a workaround by addind a Execute Process Task before the second File System Task that pings to the localhost. This results in a 5 second delay, but there must be a better solution. Anyone?
February 6th, 2008 4:17pm
Are the tasks reading or writing to the file?
Free Windows Admin Tool Kit Click here and download it now
February 8th, 2008 5:29pm
It'samove and a(n optional) rename action, but I found a better workaround at ssis junkie. It's anemptyfor loop with a timeexpression. Works fine as workaround!
February 9th, 2008 12:37am
This does not work. I've tried 10 seconds and nothing. Please email me if you have the solution. cbuisr@gmail.com
Free Windows Admin Tool Kit Click here and download it now
November 25th, 2008 2:07am
You can use OnTaskFailed event in EventHandler to move or copy the file instead of using OnError event.
October 2nd, 2009 11:16am
You could use the Pause Task to wait, or a File Properties Task to check/wait until the file is readable/writable - both on CodePlex, both free to use, with source.
Free Windows Admin Tool Kit Click here and download it now
October 2nd, 2009 5:57pm
Thanks for the suggestion, Divya - I was having the same problem (in 2008 R2) but using the OnTaskFailed event handler instead of OnError solved it for me. Presumably, the file has been released by the data flow task by the time that event is triggered.
July 8th, 2011 8:02am
Here are some pause options in SSIS:
http://microsoft-ssis.blogspot.com/2011/04/pause-in-ssis.html
And an other option is Wait for unlock:
http://microsoft-ssis.blogspot.com/2011/05/wait-until-file-is-unlocked.html
Or when possible in your Control Flow, do the move and rename in one File System Task...
http://www.rafael-salas.com/2007/03/ssis-file-system-task-move-and-rename.html
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2011 8:21am