SSIS - dynamic file name in data flow task

  • Hi,

    I have a data flow task which exports a table to csv and then FTP the csv to a remote location. The requirement is to have the csv file name formatted with the current date and sequence. I haven't used any variables or parameters before in SSIS. How do I do this?

    Thank you,

    Rushdi

  • How is sequence defined?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • I can get the sequence from the database using a function or I can run a stored procedure to create the file and store it in a table and then before the data flow task it will be available in SSIS. The file will b something like this

    filename_yyyymmdd_1

    1 is the sequence.

  • Have you done a search for this? It's a common requirement. Check here, for example.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Dynamic file name in SSIS can be done using expression builder. This article is nice and clear.

    https://www.sqlmatters.com/Articles/Including%20the%20Date%20in%20a%20Filename%20in%20SSIS%20using%20an%20Expression.aspx

  • Hi,

    I was able to solve the problem by getting some pieces of info from different articles. I saved the file name filename_yyyymmdd_1

    (1 is the sequence) in a db table every time the initial SP is run which prepares the data to export to csv. After the table is exported to csv in the data flow task, I used execute sql task to get the file name and save it in a variable. Next I created a file system task to rename the file using the variable. Then finally, FTP task to send the file using the same variable.

    Thank you for all your responses.

Viewing 6 posts - 1 through 5 (of 5 total)

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