ssis - rename file

nononame2021 256 Reputation points
2021-11-17T10:59:22.88+00:00

how can I rename the output file to add datetime for output excel file after export the excel file from ssis. can I add a task after generate excel file.

any reference?

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,641 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 26,376 Reputation points
    2021-11-17T12:49:38.95+00:00

    Hi @nononame2021 ,

    In SSIS it is usually done by using File System Task.
    Check it out here: rename-file-using-file-system-task-in-ssis

    0 comments No comments

  2. CarrinWu-MSFT 6,891 Reputation points
    2021-11-18T07:31:22.967+00:00

    Hi @nononame2021 ,

    Welcome to Microsoft Q&A!

    Yes, you could rename file name by using File system task, like YitzhakKhabinsky-0887 mentioned. Please refer to below details:
    FullFilePath Expression: @[User::FilePath]+"\\"+@[User::FileName]

    RenameFilePath Expression:

    @[User::FilePath] + "\\" +  
    SUBSTRING(@[User::FileName], 1, FINDSTRING(@[User::FileName],".",1) -1 ) + (DT_WSTR,4)YEAR(GETDATE()) + (DT_WSTR,2)MONTH(GETDATE()) + (DT_WSTR,2)DAY(GETDATE()) +   
    SUBSTRING(@[User::FileName], FINDSTRING(@[User::FileName],".",1), LEN(@[User::FileName]))  
    

    150340-filesystemtask.png
    150541-filesystemtaskeditor.png

    Best regards,
    Carrin


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.