question

zain001 avatar image
zain001 asked

SSIS package that unzips a '.gz' file and loads into tables

Hello, Can anyone help me creating a SSIS package that unzips a file '.gz' as soon as it gets into the folder and loads the data into the tables. Thanks
ssispackage
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Slick84 avatar image
Slick84 answered
You can use the command line 7z program to unzip this file through a script task in SSIS. Once unzipped, you can then define a data flow task and select your file as the source and your destination (if SQL Server then you can choose OLEDB Destination). You can also use the file system task control in SSIS to control what to do with the zipped file once unzipped and imported (like moving it to a processed folder of some sort, etc).
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

zain001 avatar image zain001 commented ·
But the main concern is, the package has to copy the data from the file without unzipping it and load it in the SQL Server tables. Is it possible? If yes, can you please guide me through the steps.
0 Likes 0 ·
KenJ avatar image KenJ commented ·
Nothing can read a compressed file without first decompressing it in whole or in part. you can load the entire compressed file into a table as a single entity, but it will be the entire file in a single row and column - still compressed. It won't be useful data.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.