SSIS - FTP TASK - DYNAMIC FILENAME

  • Excellent question and suggestion.

    Answer to Question: at the task, not during validation.

    I will try to set the breakpoint, however full disclosure: I haven't much experience with breakpoints and my feeble attempts so far haven't worked to well. Self-Taught and all that. It might take a day to figure it out.

  • Ten-second lesson: click once on the FTP task to select it and then hit F9 to set the breakpoint, which will appear as a red dot.

    Execution should now pause just before the FTP task runs.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • VERY HELPFUL lesson. The results in the variable are:

    User::FTPLocalPath {\\\\CorrectServer\\d_drive\\ABCD_DEPARTMENT_EXTRACT\\ABCD_DEPARTMENT_EXTRACT_20111101.txt}String

    For this file to exist the following was true and used successfully by a Data Flow Task (different variable name same contents)

    User::ArchiveSourceFull{\\\\CorrectServer\\d_drive\\ABCD_DEPARTMENT_EXTRACT\\ABCD_DEPARTMENT_EXTRACT_20111101.txt}String

    My current understanding of the \ escape character tells me this is correct. In the Message Box it shows up with the correct number of backslash (\) characters, so the msgbox code interprets it correctly... wierd

  • OK, that is weird. If it were me, I'd start thinking about deleting that FTP task and putting in another (with exactly the same settings/config, of course). Sometimes, it's as if the underlying package XML gets a bit corrupted and the good old delete/recreate method often sorts things out.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Thank you for the validation. I was thinking along those lines also. The job is JUST small enough for me to try recreating the task, and if necessary recreating the whole job.

    Thank you for the fast help.

  • No problem and good luck. Please post back when you get the problem resolved.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • please guys if someone can help, I'm creating an SSIS package to ftp a file then import it to OLE DB, my problem is, as I want to recieve the new file of the same remote directory every day, the name of that file is changing daily but with some fixed parts, i.e, abc_20120913123456.txt, so the "abc_" part is fixed then the day's date then the problem is after the date their is a randome number till the ".txt" part. so I just created a variable called FileName that can evaluate the file name as "abc_20120913.txt" but it can't get those randome numbers. so I"m asking about something equivilant to the "*" sign that can do this as in a batch file.. is there any solution to this experts ?! 🙂 thanks in advance.

  • amrashry_1991 (9/13/2012)


    please guys if someone can help, I'm creating an SSIS package to ftp a file then import it to OLE DB, my problem is, as I want to recieve the new file of the same remote directory every day, the name of that file is changing daily but with some fixed parts, i.e, abc_20120913123456.txt, so the "abc_" part is fixed then the day's date then the problem is after the date their is a randome number till the ".txt" part. so I just created a variable called FileName that can evaluate the file name as "abc_20120913.txt" but it can't get those randome numbers. so I"m asking about something equivilant to the "*" sign that can do this as in a batch file.. is there any solution to this experts ?! 🙂 thanks in advance.

    Can I suggest that you create a new thread for this?

    Quick answer: the wildcard capability you require can be handled by putting your dataflow in a FOREACH container and using a variable (returned by the FOREACH container) to hold the file name...

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Sorry, would you clarify your answer please because I'm very new to this ?

  • Hey I am also working on same task like this In SSIS ftp task...

    Here I created a variable for getting dynamic file name path for

    "LOCAL PATH"..

    @[User::LDirectoy] = "E:\LocalFilefolder\"

    @[User::LZipFilePrefix] = "KK_"

    @[User::LZipFileEndExtension] = ".rar"

    @[User::LDirectoy]+ @[User::LZipFilePrefix] + (DT_STR, 4, 1252) DAY( DATEADD("dd", -1, GETDATE() ) )+"-"+RIGHT("0"+(DT_STR, 4, 1252) MONTH( GETDATE() ),2)+"-"+(DT_STR, 4, 1252) YEAR( GETDATE() )+ @[User::LZipFileEndExtension]

    op: for this expression.." E:LocalFilefolder/KK_26-09-2012.rar"

    while debugging i am getting

    Error: Failed to lock variable "E:\LocalFilefolder\KK_26-09-2012.rar" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".

Viewing 10 posts - 31 through 39 (of 39 total)

You must be logged in to reply to this topic. Login to reply