Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have a package with the following tasks:

File System task - Create a folder if it doesn't already exist.

File System task - Delete file if it exists in the folder

FTP task - copies new file and places it in the folder.

I'm using variables to determine the path name form parameters passed on the package command line (from a SQL job).

The package fails because the FTP task can't find the folder, which is cause by the fact that the folder-creating task is not creating the folder. It's almost as if the FTP task is running BEFORE the file system tasks have executed, or concurrently with the files system tasks.

What I have tried:

0) If I create the folder manually before running the job, the job runs successfully.

1) If I let the package try to create the folder, it fails at the FTP task because the folder I specified doesn't exist because it wasn't created by the folder creation task.

3) I tried setting the "next task" arrow to both completion and success, but I get the same result.

4) I tried adding SQL tasks that performed WAITFOR DELAY '00:00:05' between all of the tasks.

5) If I disable the FTP task in the package, the folder creating task creates the folder successfully.

IMPORTANT TO NOTE -----------------------------------------------------------

I do NOT want to use a script task for this.

I do NOT want to create another package just to handle the files system tasks.
Posted
Updated 23-Sep-18 10:24am
v2
Comments
CHill60 21-Sep-18 4:18am    
"It's almost as if the FTP task is running BEFORE the file system tasks have executed, or concurrently with the files system tasks" ... highly likely if you haven't defined the Precendence Constraints properly.
Rather than creating another package have you tried sequence containers?
#realJSOP 21-Sep-18 11:33am    
I googled those, and it didn't appear to me that was the answer. I could try it and see, but I'm not optimistic. I wasn't aware there were "precedence constraints" to set. I'll look into it.

EDIT====================================

Precedence constraints are not available in 2008R2... :(
#realJSOP 21-Sep-18 13:28pm    
I put the filesystem tasks into one sequence container, and the ftp task into another one, and it seems to have fixed the problem. I don't understand why it should matter. I thought tasks were run sequentially if they were joined with arrows.
CHill60 22-Sep-18 17:17pm    
Not always... I've had packages that never ran the same way twice in a row (until I made them!).
Sorry I missed the version info
#realJSOP 23-Sep-18 8:33am    
post your first comment as a solution, and i'll mark it as the answer.

1 solution

Summary of the comments which led to a solution:

I first suggested checking the Precedence Constraints. My bad as the question clearly states SQL2008R2 and these didn't come along until later (2014?).

However I also suggested using Sequence Containers.. which seemed to do the trick.

I'll try to post a link to the docs in a moment and apologies if any of this turns out in Greek (phone is having a funny moment)

Edit...here's the link, Tips and Tricks for SQL-BI: Sequence Container in SSIS[^]
 
Share this answer
 
v2
Comments
#realJSOP 24-Sep-18 5:29am    
It never fails to amaze me when someone 1-votes an answer here, especially when the answer was *the* answer.
CHill60 24-Sep-18 11:03am    
LOL! I'm used to it! It was someone with low rep so probably someone I upset earlier :-)
#realJSOP 24-Sep-18 15:21pm    
SMFH - the same guy just down-voted my question...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900