May 20, 2008 at 7:31 am
I’m having a problem of how I can do this in SSIS( file must be zipped, the zipped file must have the same name, but have extension .C001. The zipped file must be given a password and saved to a folder on a server. The folder where it is saved to must be a variable, the person who runs the DTS package must supply the location to where the zipped file must save. E.g. ‘\\sfh-th1\DTS’)
May 20, 2008 at 8:11 am
If you're using WinZip, you'll need the "pro" version, which comes with command-line abilitites, and a trip to the "shell", what ever it's called in SSIS.
--Jeff Moden
Change is inevitable... Change for the better is not.
May 20, 2008 at 8:58 am
To expand on Jeff Moden's post. You will need to use the Execute Process Task. You will need a Zip utility with a command-line capability.
😎
May 20, 2008 at 1:42 pm
In our shop use 7-zip (http://www.7-zip.org/), which is a freeware zip utility with command line support. It will likely do what you need if you don't already have a package that will do it.
May 21, 2008 at 10:12 am
Hi,
You need to work around with something like this....Find all command options available through winzip..It has password (-s) command etc...You need to use xp_cmdshell, unless you are not fan of it and build dynamic sql .
select @execstr = 'master.dbo.xp_cmdshell ''c:\winzip\Wzzip.exe -m -ybc -s(password) -y '
+ rtrim( @BackupPath ) -- zip destination full path
+ rtrim( @Name ) -- zip destination filename part
+ '.zip ' -- zip file extension
+ rtrim( @BackupPath ) -- backup file source full path
+ rtrim( @Name ) -- backup filename part
+ rtrim( @FileType ) -- backup file extension
+ '''' -- close single quote for xp_cmdshell
-V
May 21, 2008 at 10:21 am
You may also use the Script task and a .Net library to accomplish this...
Ben Sullins
bensullins.com
Beer is my primary key...
May 21, 2008 at 10:29 am
veenagireesha (5/21/2008)
Hi,You need to work around with something like this....Find all command options available through winzip..It has password (-s) command etc...You need to use xp_cmdshell, unless you are not fan of it and build dynamic sql .
select @execstr = 'master.dbo.xp_cmdshell ''c:\winzip\Wzzip.exe -m -ybc -s(password) -y '
+ rtrim( @BackupPath ) -- zip destination full path
+ rtrim( @Name ) -- zip destination filename part
+ '.zip ' -- zip file extension
+ rtrim( @BackupPath ) -- backup file source full path
+ rtrim( @Name ) -- backup filename part
+ rtrim( @FileType ) -- backup file extension
+ '''' -- close single quote for xp_cmdshell
-V
You don't need to use xp_cmdshell. As I stated earlier, you can also use the Execute Process Task. That is how we use gzip to compress files before FTPing them to an outside source.
😎
May 21, 2008 at 10:33 am
xp_cmdshell is disabled by default in SQL 2005 so unless you have had your administrators enable it (not recommended) you won't be able to use it. Like Lynn said, us the Execute Process task or build a Custom Assembly to handle it...
Ben Sullins
bensullins.com
Beer is my primary key...
May 22, 2008 at 12:59 am
Hi All
thanx for your help.
If i use Execute Process Task how is the user of the package going to be able to supply the location to where the zipped file must be saved. coz when u use Execute Process Task it save on the some folder when the file your zipping is.
And how can i change the extension of the zip file coz it needs to change from C001 to C002 ever time when i run the package?
regards
Nosi
May 22, 2008 at 6:48 am
If necessary, you could follow the Execute Process task with a File System task to move and/or rename the file. The source and destination paths can be mapped to user-defined variables which can for example be supplied as part of a command line or modified in a configuration file.
May 23, 2008 at 7:24 am
I Just recently posted a blog post on this: http://blog.cybner.com.au/2008/05/unzip-files-using-ssis.html
Hope this may help 🙂
Catherine Eibner
cybner.com.au
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply