SQuirreL
SQuirreL

Reputation: 129

SSIS Package copy/move based on condition. check archive folder before move/copy to process

I'm working on a Ssis package and would like to know, how I can achieve the following:

I want to move files from a drop folder into a process folder and I want to implement the following rule:

If file does not exist in archive move file to process and archive. If file exists in archive drop file (don't archive and don't move to process).

The test "if" exists must be based on file name and time stamp (when raw file got created).

Any ideas?

Upvotes: 0

Views: 2376

Answers (1)

Maverick
Maverick

Reputation: 1185

You can do this by simple way which I have done this in few days back.

1) Create a variable FileName(string), FileExists(boolean)

2) Drag the File System Task and based on your condition you can Copy/Move/Delete file or folder.

3) In my case based on the time frame I archive the file which is move the file from one folder to another by adding one more variable name DestinationFolder (string).

4) The condition I applied is in Precedence Constraint (right click on properties or double click Precedence constraint editor then expression and constraint and give the expression as @fileexists == TRUE or FALSE).

This should work just fine.

Upvotes: 2

Related Questions