Solved

cannot execute WinRAR inside DTS package

Posted on 2007-11-15
9
1,611 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

 
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 43

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

751 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