Skip Navigation LinksHome > View Post

SSIS Compress File Task Fix

IMPORTANT This post and the corresponding code was created some years ago. I've hardly worked with SSIS since and so don't plan to update the code to support the latest versions of SQL Server. The component and source were designed for SQL Server 2005 and will not work in SQL Server 2008 or later. You can take the code and change it at your will (I hear it's a simple fix). I considered pulling the posts altogether but a number of people have found value in these ideas even if they have to modify the code.

Thanks to Paul Smith for spotting that there's a small problem with the SSIS Compress File Task.

I rather foolishly opted to read the whole file in one go, which worked well for my rather limited tests but if you get a big file (like Paul's 1GB example) the whole thing falls over with an OutOfMemoryException. Kind of obvious really - sorry.

Anyway, I've changed the code to now read the source file in 16KB chunks which should solve the problems. Download the latest here:

Apologies and thanks for the feedback.

UPDATE: The compres file task does now support decompression (see comments): SSIS Compress File Task now with added decompression.

Tags: SQL SSIS

 
Josh Post By Josh Twist
8:30 AM
03 Oct 2006

» Next Post: The Awesome Power of IoC Part III
« Previous Post: Remoting using interfaces and creating appdomains

Comments are closed for this post.

Posted by Mark R @ 25 Oct 2006 6:19 AM
Do you have a uncompress Task?

Posted by Josh @ 25 Oct 2006 8:08 AM
Err... no...

I kind of imagined the compression would be automated for archiving purposes and viewing the archive would be an adhoc manual job with a copy of WinZip to hand. Why do you want one?

Posted by Mark Reen @ 26 Oct 2006 5:36 AM
We have SSIS Jobs that download zip files from partner sites that have to be unzipped then futher processed in SSIS. Right now we are using a cmd shell to unzip the files but would like to keep it all in SSIS.

Also, do you have any URL's for other SSIS custom Tasks

Posted by Josh @ 27 Oct 2006 12:27 AM
Hi Mark,

Sorry but the task doesn't support decompression yet. You could easily add it if you look at the source though. Also, we have our other tasks available here:

http://www.thejoyofcode.com/SSIS_Xmlify_Data_Flow_Task.aspx
http://www.thejoyofcode.com/SSIS_Set_Variable_Custom_Task.aspx
http://www.thejoyofcode.com/SSIS_Custom_Logging_Task_for_Event_Handlers.aspx

Also - check out the www.sqlis.com - they have a lot of cool tasks available on their website.

Josh

Posted by Tarik Arrad @ 26 Mar 2007 8:04 AM
Plz how to compress multiple files?

Posted by Josh @ 26 Mar 2007 10:06 AM
Hi Tarik,

Sadly Gzip doesn't allow the compression of multiple files. You'll need to use something like WinZip to do this.

Josh

Posted by rdass @ 01 Dec 2009 2:32 PM
Hi Josh,
Can you guide me how to donwload gzip file from http site using authentication.
Cheers
Dass

© 2005 - 2014 Josh Twist - All Rights Reserved.