SQLTeam.com | Weblogs | Forums

1073548540:error message

Hi

Im getting the follwoing error when trying to delete a file from a folder when running an ssis package

1073548540:An error occurred with the following error message: "The process cannot access the file because it is being used by another process.".

I put in a task script to put in a delay code was just WAIT FOR DELAY '00:00:45' which seem to work. but now thats stopped working. anyone any ideas of how to fix this issue

Are you running it manually?

i am for now yes. but this will also be automated. need to get it working manually first

close the SSIS package, kill any remaining SSIS left over stuff in your Task Manager, reopen SSIS and rerun. SSIS at times keeps the lock on the file. CLosing and reopening should help. Usually this only happens when running SSIS manually to me

and any way with logic to somehow do this. it it happens when it goes to automated for clients i cant keep having to clear the process.

Will you be running ssis manually at client site?

no. it suppose to run by itself.

As mentioned earlier, this issue happens 99% when running manually. So schedule it and run it and see if it locks the file, it shouldnt

dam it . its doing it automated as well.

How do you have this setup in SSIS? What is the constraint between the process that uses the file (assuming you are loading the data from the file into SQL Server) and the task to delete the file?

It seems that the task to delete the file is executing before the task that is reading the file has completed. That tells me the constraint is not setup correctly.

:rofl: Sorry Ronan Healy. You didn't specify that.

its done after the files have been read in

This seems overly complex...and it isn't clear on the dependencies because they are covered up.

You have a foreach loop that checks for files in an input directory...but doesn't do anything with the files in that loop. You then create an archive directory, get a batch number??? and 'File Success'?

That goes to an execute SQL task - no idea what that is doing...assume that is your 'wait'.

That then goes to a step that appears to delete all old files...

Then you have another foreach inside a sequence container - with a filenamelist??? no idea what that loop is doing.

I am not seeing any data flow tasks...so it really isn't clear what is supposed to happen.