Bulk insert is locking a file delete task

Hello,

I have an SSIS package doing a bulk insert from a file. Then later on I'm trying to delete that file (in a file delete task), but I'm getting an error:

[File System Task] Error: An error occurred with the following error message: "The process cannot access the file 'xyz' because it is being used by another process.".

I'm wondering if there isn't some way to 'tweak' the bulk insert syntax so that it doesn't lock the file?

Thanks,

phil

June 19th, 2015 12:44pm

Hi Phil,

nope, it is possible that a handle is open to the file e.g. the write operation to it is still ongoing.

I suggest you install the ProcessExplorer tool to find out what application holds the lock.

Free Windows Admin Tool Kit Click here and download it now
June 19th, 2015 1:43pm

Hi Phil,

I executed Bulk Insert Task Parallel and it works fine. So it means BIT doesn't lock the file. 

Check whether your file is open in some other process or not

Best Regards

Parth Patel

June 19th, 2015 1:52pm

If I comment out the bulk insert task the file delete works fine, so I'm pretty sure that's what's holding the lock. My 'delete' file happens later on in the process flow and is not done in parallel with the bulk insert. I'm just wondering if there is a way to release the lock or change up the bulk insert syntax so that it won't hold a lock. 

Thanks,

phil

Free Windows Admin Tool Kit Click here and download it now
June 19th, 2015 2:31pm

Can you post here (or elsewhere) a picture of your package design?
June 19th, 2015 10:59pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics