Xp_cmdshell returns error code 128

  • Hi,

    am using xp_cmdshell in SQL2k to copy a file from one place to another but sometimes it fails and gives the error code as 128...Does anybody know the reason...This particular error code is undocumented by Microsoft..Anyhelp would really be appreciated...Thanks in advance..

  • What command are you using to copy the file?

    The return code can be the return code of the command you're running even though it states in BOL that valid return codes can be 0 or 1.

  • SELECT @sCmd = 'copy "' + @ReportPath + '\'+ @sYYYY +'\'+ @sYYYYMMDD + '\EERS'+ @CGAppID + '.txt.' + @nInstallshieldID + '" '+ @ReportPath --02/05/05 Solomon M

     EXEC @nRetCode = master..xp_cmdshell @sCmd

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply