Link to home
Start Free TrialLog in
Avatar of frankytee
frankyteeFlag for Australia

asked on

cannot execute WinRAR inside DTS package

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
Avatar of k_rasuri
k_rasuri

zip them instead of rar and see if it works
Avatar of frankytee

ASKER

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.
Avatar of Anthony Perkins
>>however it fails with the message:<<
When you run it manually or as a scheduled job?
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.
ASKER CERTIFIED SOLUTION
Avatar of Barthax
Barthax
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
WinRAR thinks you have given it a RAR file to add stuff to - hence the notice that it doesn't recognise the format.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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.