Using SSIS, need to zip txt files and move to archive location

ASHISH SINGH 21 Reputation points
2021-07-04T01:47:26.637+00:00

Hi All, I’m using SSIS package to make txt extracts from sql tables. Further I want to make them zipped with password and move them to our archive location. Pls guide how I can do mentioned things in same SSIS package.

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

Accepted answer
  1. CarrinWu-MSFT 6,806 Reputation points
    2021-07-05T09:14:54.763+00:00

    Hi @ASHISH SINGH ,

    Welcome to Microsoft Q&A!

    As JeffreyWilliams-3310 mentioned, you could zip files using a script task. Please refer to the process from this video. For the script, please read below links:
    How to: Compress and extract files
    File Encryption and Decryption in C#

    In addition, you could zip files using Execute Process Task, but this task cannot encrypt the files. Please refer to this blog

    Best regards,
    Carrin


    If the answer is helpful, please click "Accept Answer" and upvote it.
    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.

2 additional answers

Sort by: Most helpful
  1. Jeffrey Williams 1,881 Reputation points
    2021-07-04T16:25:08.297+00:00

    Use a script task to call out to your zip utility to compress and password protect the file. Then - using file system commands in that same script task move the file to the archive location. You cannot use standard System.IO.Compression library to add a password, therefore you need a third-party library.

  2. COZYROC 96 Reputation points
    2021-07-05T11:59:53.91+00:00

    I would recommend you check the commercial COZYROC Zip Task. You can compress and encrypt with a password and the task is completely integrated.