I have below code in sql agent job step of type cmdexec . This step is supposed to copy a file using robocopy and based on the return code apply the if logic to return 0 .
My issue: robocopy step is working but not the if logic. Job is returning what ever the return code returned by robocopy.
ROBOCOPY c:\Source D:\destination myfile.txt ^& IF %ERRORLEVEL% LEQ 1 exit 0
Ravi Kumar