Home > Archive > Microsoft SQL Server Desktop Engine > February 2006 > xp_cmdshell returns unexpected Return codes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author xp_cmdshell returns unexpected Return codes
Solly

2006-02-25, 9:45 am

Hi All,

I am using xp_cmdshell bundled with SQL2K to copy a file from one
location to another on the same machine. This sometime works and
sometimes fails and return an error code as 128. The documented return
codes of this extended procedure is only 0(success) and 1(fail).
Has anyone faced this issue earlier?.. Or does anyone know when this
situation can occur?..
Any help will be highly appreciated..Thanks in advance...

Andrea Montanari

2006-02-25, 9:45 am

hi,
Solly wrote:
> Hi All,
>
> I am using xp_cmdshell bundled with SQL2K to copy a file from one
> location to another on the same machine. This sometime works and
> sometimes fails and return an error code as 128. The documented return
> codes of this extended procedure is only 0(success) and 1(fail).
> Has anyone faced this issue earlier?.. Or does anyone know when this
> situation can occur?..
> Any help will be highly appreciated..Thanks in advance...


actually, even if BOL refers 0 as success or 1 as failure,128 clearely is
an error set code as all different from 0 is...

personally I never heard of such a return code, but am aware of problems
regarding a different behaviour set afte sp3a of SQL Server 2000, that
usually denies non sysadmin members to execute that procedure along
others...
http://www.novicksoftware.com/Artic...dshell-Woes.htm
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.16.0 - DbaMgr ver 0.61.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--------- remove DMO to reply


Solly

2006-02-25, 9:46 am

But I am using the SQL SERVER start up account to run this xp_cmdshell.
And what is suprising me most is that it sometime works and sometimes
not..
any clue on what is goin wrong?..

Andrea Montanari

2006-02-25, 9:46 am

hi,
Solly wrote:
> But I am using the SQL SERVER start up account to run this
> xp_cmdshell. And what is suprising me most is that it sometime works
> and sometimes not..
> any clue on what is goin wrong?..


return code 128 does not bring me ideas...
can you collect the exception raised when failing?
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.18.0 - DbaMgr ver 0.62.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--------- remove DMO to reply


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com