Home All Groups Group Topic Archive Search About

Issues with xp_cmdshell

Author
25 Aug 2006 5:00 PM
ngorbunov
I have an xls file that is about 358 kb and contains about 1569 rows.
I am using the following code:

Code:
Use master
DECLARE @reult varchar(200)

EXEC @result = xp_cmdshell '\\ITITPAFS02\pds\voicenet\isiti\winzip\wzzip.exe \
\ititpafs01\pds\inetpub\ftproot\accumen\political  \at0123.zip \\ititpafs01\
pds\inetpub\ftproot\accumen\political  \at0123.xls'

IF (@result = 0)
     PRINT 'success'
ELSE
     PRINT 'Failure'

It runs longer than 9 min. I just kill it. Am I doing something wrong?

Thanks,
Ninel


Author
25 Aug 2006 9:44 PM
cphite
ngorbunov wrote:
Show quote
> I have an xls file that is about 358 kb and contains about 1569 rows.
> I am using the following code:
>
> Code:
> Use master
> DECLARE @reult varchar(200)
>
> EXEC @result = xp_cmdshell '\\ITITPAFS02\pds\voicenet\isiti\winzip\wzzip.exe \
> \ititpafs01\pds\inetpub\ftproot\accumen\political  \at0123.zip \\ititpafs01\
> pds\inetpub\ftproot\accumen\political  \at0123.xls'
>
> IF (@result = 0)
>      PRINT 'success'
> ELSE
>      PRINT 'Failure'
>
> It runs longer than 9 min. I just kill it. Am I doing something wrong?

Try putting your command script in a .bat file and calling that from
xp_cmdshell.  Try running the .bat file directly first to see how long
that takes.

Finally, make sure the account you're using to run SQL has access to
all of the directories and files you are using.

AddThis Social Bookmark Button