Re: Run Batch Files with SQL Server Agent

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: DeeJay Puar (deejaypuar_at_yahoo.com)
Date: 02/23/04


Date: Mon, 23 Feb 2004 10:39:30 -0800

Hi

Thanks, but that's exactly how I have been trying to run
it, but it does not work.

I am running the job with an administrative account that
has the required permissions.

I have tested the script by running is manually on the
server and it works fine.

I wonder what gives.

DeeJay
>-----Original Message-----
>Hi,
>
>In SQL Agent Jobs -- Step option, after
selecting 'Operating System Command
>(CmdExec)' , In the command window you can type
>
>e:\sqlbackups\delete.bat
>
>(This will call the batch file delete.bat based on the
schedule interval)
>
>Thanks
>Hari
>MCDBA
>
>"DeeJay Puar" <deejaypuar@yahoo.com> wrote in message
>news:14f3201c3fa33$599d4120$a001280a@phx.gbl...
>> Hi,
>>
>> I am trying to run a batch file using the SQL Server
Agent
>> (I have scheduled a job). I have chosen the step type to
>> be 'Operating System Command (CmdExec)'. But I am not
sure
>> how to code the actual command.
>>
>> The batch file is located at: e:\sqlbackups\delete.bat.
>>
>> How do specify the Agent to call this batch file?
>>
>> Thanks,
>>
>> DeeJay
>>
>
>
>.
>



Relevant Pages

  • Re: Using SQLCMD to test Connection
    ... Assuming you really execute the batch file from the operating system command interpreter, then you should now have some other error compared to the one you posted earlier. ... Above is because you are connected to SQL Server from SSMS, and SQL Server expects a SQL command. ... SQLCMD is not a SQL command, ...
    (microsoft.public.sqlserver.clients)
  • Re: Script to stop a SQL service
    ... Would the syntax be the same if I ran the command line script from within a ... I'm planning on running this batch file from within the BackUp Exec ... > You can also use SQL-DMO to stop/start a SQL Server instance. ... >> Is there a script that I can run to stop a particular SQL server service ...
    (comp.databases.ms-sqlserver)
  • Re: Can XPe SP1 and SP2 co-exist on the same development machine?
    ... > There is some information about the database in the system databases too, ... > This can be done from a batch file too, through oqsl.exe (in the SQL Server ... > command line, so it's not broken in this post by the time you read it. ...
    (microsoft.public.windowsxp.embedded)
  • Re: Command Line & MS SQL Server
    ... it is possible in SQL server and it is quite simple as well. ... I need to create login "Test" in SQL server and create a table named ... Now you can execute the batch file from command prompt. ...
    (microsoft.public.sqlserver.setup)
  • Re: log off command
    ... I simply execute the batch file and let them play... ... If it's by the hour you don't need a script. ... You can logoff a sessionname or a session ID in each case you have to ... Is it possible to issue the command from user1's logon to logoff ...
    (microsoft.public.windowsxp.basics)