1

I have a cmdexec step in a sql agent job that includes a redirection into a file at the end. It works as expected from a CMD shell running in the context of SQL Agent service account and produces a file in the desired location. If I run it as an agent job, however, the step 'succeeds' but never produces the output file. In both cases, the service account obviously has filesystem permissions and system rights sufficient to perform this action.

Is the cmdexec environment more restrictive in someway than just running cmd.exe?

0

Go to the advanced tab for the step. Use one of the options to capture more output such as "Include step output in history" or the "Output File" setting. This should give you more information about the step and what is happening.

  • Accepting this as the answer. The big picture is that CMDEXEC is a WinAPI call that behaves a certain way. It's entirely different than starting a command shell. – Jeff Sacksteder Sep 23 '14 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.