

Running the CLI Using Your Scheduling Manager › Integration with CA Workload Automation DE › Example: Run SQL Server Agent Job Using a Windows Job
Example: Run SQL Server Agent Job Using a Windows Job
After you identify the job, you can run it immediately using the RunJob operation.
This example runs a predefined job named MYJOB using a Windows job. The following CLI arguments are passed to the batch script:
- Name of the operation (RunJob)
- Name of the SQL Server Agent job (MYJOB)
- Target server database (MYDATABASE)
- User name (AUSER), password (3B38CA1614D55535), and domain (OURDOMAIN)
- Option to track the job to completion
To run a predefined job
- Create a Windows job in the Application.
- Enter the following information in the Basic page of the job definition:
- Name—run_job
- Agent—WINAGENT
- Command to run—wrappers\mssql_call.bat
- Arguments to pass—--operation=RunJob --JobName=MYJOB --TargetDB=MYDATABASE --UserName=AUSER --Password=3B38CA1614D55535 --Domain=OURDOMAIN --Track=Y
- Click OK.
When the job completes successfully, it indicates that MYJOB has completed successfully on SQL Server Agent.
Copyright © 2013 CA.
All rights reserved.
 
|
|