Solved

Data Flow Event Handler:  File Being Used By Another Process, Can't Move

Posted on 2011-02-20
10
344 Views
Last Modified: 2012-05-11
I have an onError event handler attached to my Data Flow task so that just in case I get a CSV file that is mis-formatted, I can move it into a Bad File folder.

The onError event fires, but it won't move the file because it says it is being used by another process.  I do not get this same type of error later in the Control Flow of the package when I attempt to move the file after successful processing.

Any ideas on how to release the file from the process first and then move?  I'm pretty sure it's being held by some DTS process but I have to believe it can be released and then moved.
0
Comment
Question by:davidcahan
10 Comments
 
LVL 4

Expert Comment

by:rocky_lotus_newbie
Comment Utility
please check if you are able to find the details of the process locking the file after the OnError event fires from  -
Computer Managent -> Shared Folders -> Open files.

Thanks,
0
 

Author Comment

by:davidcahan
Comment Utility
nothing
0
 
LVL 17

Assisted Solution

by:dbaSQL
dbaSQL earned 100 total points
Comment Utility
If you're absolutely certain the file is not otherwise in use, possibly you should check the MaxConcurrentExecutables and EngineThreads:

http://stackoverflow.com/questions/4759892/file-in-use-error-in-ssis
http://blogs.msdn.com/b/sqlperf/archive/2007/05/11/implement-parallel-execution-in-ssis.aspx
0
 

Author Comment

by:davidcahan
Comment Utility
It's definitely not in use by any other "entity" except the SSIS package.  I've actually read that this behavior (not being able to move a file source during a dataflow onError event) is a "bug".  
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 30

Accepted Solution

by:
nmcdermaid earned 400 total points
Comment Utility
It appears to make sense. The data flow has to be using it to throw the error, and its still effectively using it during the error event, so its locked.


Perhaps you should do one of the following:

1. Ignore it and move on the the next one. Assuming a successful file is moved to a 'processesd' folder then you know that everything thats left is a problem file and can be moved

Or...

2. Explicitly log the file path to a failure table. Then at the end of the process, go through this table and move them all.


0
 

Author Comment

by:davidcahan
Comment Utility
that's actually a really good idea.  I never considered that.  my root folder can be both filles to process and failed files, while my archive can be successfully processed files.

thanks.
0
 

Author Closing Comment

by:davidcahan
Comment Utility
I gave points to @dbaSQL also because I wasn't sure the links given actually solved my problem but I also didn't have enough time to fully test.  ultimately though @nmcdermaid's solution was the most feasible at the time.
0
 
LVL 17

Expert Comment

by:dbaSQL
Comment Utility
Thank you for the points, davidcahan.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now