April 19, 2010 at 10:35 am
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,
April 19, 2010 at 10:45 am
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.
April 19, 2010 at 11:42 am
Still not work.
April 19, 2010 at 11:45 am
Repost your current command.
April 19, 2010 at 2:14 pm
"sqlcmd -SABCDEF -E -d TEST -i \\ABCDEF\L$\ALTERINDEX.sql -o \\ABCDEF\T$\test.txt"
April 19, 2010 at 2:23 pm
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.
April 19, 2010 at 2:49 pm
Thanks! It works now. I appreciate your help.
April 19, 2010 at 2:52 pm
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
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy