Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12345»»»

Using SSIS to zip files and email the zipped files Expand / Collapse
Author
Message
Posted Monday, September 22, 2008 10:44 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Wednesday, October 8, 2014 9:11 AM
Points: 719, Visits: 695
I saw that too.

If Len(strDay) = 1 Then
strMonth = "0" + strDay
End If

probably should be

If Len(strDay) = 1 Then
strDay = "0" + strDay
End If
Post #573703
Posted Monday, September 22, 2008 1:51 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, December 12, 2013 11:12 AM
Points: 7, Visits: 74
(grin) Maybe I should have been less obtuse...
What I was REALLY hoping for was "someone" to share how they'd done it WITH the Windows functions.

"OH GREAT SOMEONE, OUT THERE IN THE INTERWEB... Hear my request..."

Does the Interweb respond to sacrificial offerings?
Post #573834
Posted Monday, September 22, 2008 2:46 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, April 4, 2014 4:40 PM
Points: 751, Visits: 917
Excellent article. Thank you.

---
Timothy A Wiseman
SQL Blog: http://timothyawiseman.wordpress.com/
Post #573861
Posted Monday, September 22, 2008 5:25 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, May 20, 2013 5:43 PM
Points: 19, Visits: 80

What I was REALLY hoping for was "someone" to share how they'd done it WITH the Windows functions.


Well maybe this example is not with windows functions as they are API calls. But I can give an example using a .NET DLL Assembly!

1) Download SharpZipLib and install into the GAC (yes, has to be in the GAC. This is a MS decision!)
2) Add a script task
3) Edit the script
4) Add a reference to the DLL by right clicking on references and adding the reference
5) Initialise the object and use the assembly functions for Zip creation :)

We use package variables for the output dir and the name of the zip file (we add date info to this filename).

If you want, I possibly could write up a step-by-step article on how to achieve this in managed code.

Hope this makes sense :)


Post #573934
Posted Monday, September 22, 2008 8:49 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: 2 days ago @ 2:50 PM
Points: 1,343, Visits: 7,184
there is a free component that does this for you:
http://www.thejoyofcode.com/SSIS_Compress_File_Task.aspx


also, you can use an Execute Process Task and call winzip.exe:
http://dichotic.wordpress.com/2007/07/24/using-winzip-within-ssis/



bc
Post #574000
Posted Tuesday, September 23, 2008 3:23 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, May 31, 2013 2:05 AM
Points: 132, Visits: 164
This is really a great article with great simplicity.
Thanks for sharing.

Please keep it up
Post #574151
Posted Tuesday, September 23, 2008 3:43 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, February 28, 2011 3:01 AM
Points: 8, Visits: 164
Hi,

Nice article.

I rather instead of using an Execute Process Task , that uses an external file, it's better (for me) to use the 7z instruction on the Script Task and put the 7z.exe in the Windows Assembly folder.


Regards.
Post #574161
Posted Tuesday, September 23, 2008 5:03 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, April 3, 2013 3:05 AM
Points: 1, Visits: 51
Hi,

I agree whit this article, but when I develope this kind of package (Mail Task, FTP Task, Execute Process task), I prefere use the expressions andthe variables, evaluated as Expressions. I try to use the Script Task only for some task that SSIS can not do natively.

Sorry for my english :)

Rmi
Post #574207
Posted Tuesday, September 23, 2008 3:45 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, October 20, 2014 12:27 AM
Points: 2,278, Visits: 3,061
Bk (9/22/2008)
Thanks for the great article, Carolyn!

Shouldn't it also be possible to use native Windows functions to compress and uncompress groups of files into .zip-compatible archives? NOT "compress" like the command line .exe or operating system file attribute, but similar to how I can view/create compressed .zip-compatible files from Windows Explorer.

Any thoughts?
Bk

No, you cannot do this via Windows Compressed folders. You cannot do this because Windows Compressed folders does not have an interface or allow the use of command line switches . You could probably do some hacks to get it working, but it is outside the Windows built-in functionality. You will have to go with a non-Windows tool or API to accomplish this task.




My blog: http://jahaines.blogspot.com
Post #574810
Posted Tuesday, September 23, 2008 6:29 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, December 12, 2013 11:12 AM
Points: 7, Visits: 74
NO Windows API to manipulate compressed folders? Ok then....
Post #574836
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse