Solved

cannot execute WinRAR inside DTS package

Posted on 2007-11-15
9
1,606 Views
Last Modified: 2013-12-01
sql server 2000
i have a simple DTS package that extracts millions of records from a table to a csv file (simple transform data task). the next step in the DTS is an "execute process" task where i want to run WinRAR to compress that csv file.

win32 process: C:\Program Files\WinRAR\WinRAR.exe
parameters: A E:\OUTPUT\TEST\History_Archive.csv

however it fails with the message:
!  E:\OUTPUT\TEST\History_Archive.csv: The archive is either in unknown format or damaged

there is nothing wrong with the csv file as i can compress it manually using WinRAR from Windows explorer on the server.
i need to get the DTS working as i want to schedule it monthly.

thanks
0
Comment
Question by:frankytee
9 Comments
 
LVL 8

Expert Comment

by:k_rasuri
ID: 20293957
zip them instead of rar and see if it works
0
 
LVL 19

Author Comment

by:frankytee
ID: 20294121
if it was up to me i would but management has ordered that we move to WinRAR because of its greater compression so i dont have that choice. Its an MIS db so we get heaps of large extracts etc so thats why we moved to winRAR.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 20294522
>>however it fails with the message:<<
When you run it manually or as a scheduled job?
0
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 
LVL 19

Author Comment

by:frankytee
ID: 20294620
when i run the dts manually. haven't scheduled it yet as its not finalised (nor working) and the dba doesn't want dodgy adhoc jobs floating around. Also winzip has been uninstalled so it has to be WinRAR. i've just been told that i should create a batch file that runs the winRAR and then execute that batch file directly but since i've posted this i'll rather just execute the WinRAR (if thats possible) as i dont understand why DST would give options to execute external exe but then not work! i think i'll have to investigate the parameter strings.
0
 
LVL 19

Accepted Solution

by:
Barthax earned 400 total points
ID: 20296959
With the A command, WinRAR requires three parameters: "A", the RAR file to create and the file to add to the RAR file.

WinRAR A <rarfile> <file(s) to add>
0
 
LVL 19

Expert Comment

by:Barthax
ID: 20296963
WinRAR thinks you have given it a RAR file to add stuff to - hence the notice that it doesn't recognise the format.
0
 
LVL 42

Assisted Solution

by:Eugene Z
Eugene Z earned 100 total points
ID: 20307897
make sure that WinRAR.exe is installed on sql server box
use UNC path to file (\\servername\share)


use MS-DOS RAR  utility (located in winrar installation folder (prog files..)
you can call it with xp_cmdshell

  RAR Syntax

    RAR <command>  [ -<switches> ]  <archive>  [ <@listfiles...> ]
        [ <files...> ]  [ <path_to_extract\> ]
0
 
LVL 19

Author Closing Comment

by:frankytee
ID: 31411901
i ended up using a batch file to do this as i needed to record the process time etc.
but as i stated i wanted to know how to do this directly executing a win process in DTS so after some experimenting the solution posted by Barthax was the closest solution but i used different parameter switches like below (because it was used by one of my former colleagues in an earlier DTS that i found):
u -ibck -ep "full path and file name of rar file" "full path and name of file to archive"
i read the RAR help file and it did not show "-ibck" as a valid switch. but it worked anyway. does anyone know what it stands for?
i found that i had to put the full path of the file to be archived and not just the file name as otherwise RAR did not recognize it. Also how would the list of files be seperated? comma?

thanks
0
 
LVL 19

Expert Comment

by:Barthax
ID: 20382123
The -ibck command forces WinRAR to run in the background (should sit in the system tray) which prevents it from taking as much CPU as it can get.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how the fundamental information of how to create a table.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question