x

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
more ▼

asked Aug 25 '11 at 04:45 AM in Default

zain001 gravatar image

zain001
61 7 7 7

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

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).
more ▼

answered Aug 25 '11 at 05:53 AM

Slick84 gravatar image

Slick84
1.3k 75 102 142

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.
Aug 25 '11 at 08:26 PM zain001

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.
Aug 26 '11 at 06:16 AM KenJ
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x900
x26

asked: Aug 25 '11 at 04:45 AM

Seen: 1900 times

Last Updated: Aug 25 '11 at 04:45 AM