JOT STEP = Operating System [CMDEXEC]

  • I create below as a job in MS SQL 2005:

    Job Step = Operating System [CMDEXEC]

    Run as = SQL Agent Service Account

    COMMAND =

    "sqlcmd -SABCDEF -E -d TEST -i L:\ALTERINDEX.sql -o T:\test.txt"

    The error mesage is The system can't find file specified.

    But same command run fine while I run interactively from the commmand prompt.

    Please assist. Thank you,

  • DimDim (4/19/2010)


    I create below as a job in MS SQL 2005:

    Job Step = Operating System [CMDEXEC]

    Run as = SQL Agent Service Account

    COMMAND =

    "sqlcmd -SABCDEF -E -d TEST -i L:\ALTERINDEX.sql -o T:\test.txt"

    The error mesage is The system can't find file specified.

    But same command run fine while I run interactively from the commmand prompt.

    Please assist. Thank you,

    You probably need to add the complete path to sqlcmd. When run as a job, the system may not have the PATH defined such that it can determine where sqlcmd is located to run it.

  • Still not work.

  • Repost your current command.

  • "sqlcmd -SABCDEF -E -d TEST -i \\ABCDEF\L$\ALTERINDEX.sql -o \\ABCDEF\T$\test.txt"

  • DimDim (4/19/2010)


    "sqlcmd -SABCDEF -E -d TEST -i \\ABCDEF\L$\ALTERINDEX.sql -o \\ABCDEF\T$\test.txt"

    Try taking out the double quotes. I don't see any text strings with embedded spaces.

  • Thanks! It works now. I appreciate your help.

  • Glad to help.

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

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