Scheduling Batch Cmd from SQLAgent

  • Mornin' all,

    I've been trying to use the SQLAgent to run a batch command on the server but nothing seems to happen. I''ve never tried this before so I could do a few "have you?" type suggestions.

    DeltaKilo

  • What version SQL Server? NT or Windows 2000?

    And how have you tried to get SQL Agent to run the batch command?

  • 7.0/NT

    Simply created a job CmdExec and put the full path to the .exe in the box where the T-Sql normally goes

  • You have set command type as operating system command, then entered command in the command box eg: e:\eis\jobs\updates.bat. where updates.bat is you batch command file.

    You have checked the enabled box?

    Who have you got as owner of the job?

  • I'd check the permissions for whatever account is assigned to cmdexec. Have you tested the batch file as a stand alone?

    Andy

  • Hi ,

    Haven't check the enabled box yet as I have been starting the job manually to test. I'm the owner.

    How do you mean Andy "whatever account is assigned to cmdexec." The exe works fine. Do I need to put it in a .bat format?

  • I asked about the enabled box because I had a job set up where the enabled box was not checked and it just refused to do a thing - not sure if this is a quirk with the SQL installation I have or what! If you can run the exe then it should not be a permissions problem.

  • Aha P. that might be a quirk worth checking!

  • If the user is not a member of sysadmins, the job will run under the sql agent proxy account. If that account doesnt have sufficient permissions, the job will fail.

    Andy

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

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