Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2009
    Posts
    5

    Unanswered: master..xp_cmdshell Error Handling

    I'm using Exec @Result = master..xp_cmdshell to call WinZip. It gets the job done as far as zipping the files. I wanted to see what it would do if I gave WinZip a bogus source directory. After the execution @Result = 0. Surely it couldn't have been successful on the WinZip side. Is the result in this case the fact that it was able to find the WinZip executable and run it even though it most likely failed on WinZip side?

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    yes. .
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Jul 2009
    Posts
    5
    Ok thank you.

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Do you want the details?

    Code:
    DECLARE @cmd AS VARCHAR(600)
    
    SELECT  @cmd = 'xcopy c:\this_does_not_exist.txt c:\nor_this\'
    
    DECLARE @t TABLE 
        (
            err_msg VARCHAR(MAX)
        )
    
    INSERT  @t
    EXEC dbo.xp_cmdshell @cmd
    
    SELECT  *
    FROM    @t
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •