Solved

cannot execute WinRAR inside DTS package

Posted on 2007-11-15
9
1,597 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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:EugeneZ
EugeneZ 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

803 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