We help IT Professionals succeed at work.

SSIS Error: "The process cannot access the file because it is being used by another process."

arthrex
arthrex asked
on
2,971 Views
Last Modified: 2012-03-12
Hi experts,

I created a package in SSIS where I transfer Data from XML files to a database table using a foreach loop.
I have a contraint on the database table and when one of the XML files hits that constraint, the XML file should get moved to a certain ErrorFolder.

So I created an EventHandler "OnError" which holds a FileSystemTask.
See the configuration of the FST below

But I always receive the error "The process cannot access the file because it is being used by another process."

What do I do wrong?
fst.JPG
Comment
Watch Question

Check maybe you have the file opened by other application.

Author

Commented:
Hi,
thanks for your help.

No, there is no other application accessing these files. I really have no clue what the problem is...
Any further help is appreciated...

Author

Commented:
Ah ok, I think I know the problem now.

I want to move the xml file to a certain folder when the insert constraint on the database hits. So what I do is add an OnError Event on the data flow task.
But that seems to cause the problem because it seems that SSIS tries to insert the record into the database, hits the constraint and then wants to copy that file while the file is still somehow connected to the database insert statement.
So I guess the "OnError" Event is simply the wrong event.
But does anyone know what event I should use?
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
how do I close the session with the file in SSIS???
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.