![]() The following example shows how to set the active end date to : is used to the date that the job will end.The following example shows how to set the active start date to : parameter is used to define the date that the job will.The following example shows how to set the frequency to run weekly: The number 1 is to run once, the number 4 to run daily, the number 8 to run weekly,ġ6 monthly, 64 when the SQL Agent service starts and 128 when the computer is idle. The parameter is used to define how often will be the run the job. Some other parameters than can be useful for the sp_add_schedule stored procedure The following example is an c:\adw.bak d:' Some additional parameters for the sp_add_schedule parameter depends on the subsystem, if the subsystem is TSQL, theĬommand will be T-SQL statements, if the subsystem is CmdExec, the command will.The following example will show how to set the parameter into parameter is the number of minutes to wait between attempts.The following examples show how to set the number of retry attempts to 1, 2 or parameter is used to define the number of retries in case.Will show how to quit on failure (2) and how to go to the next step (3): The following examples will show how to quit when the step success (1) and also You can quit the job reporting success (value equal to 1), quit reportingĪ failure (2), go to the next step (3) and finally, go to an specific success step parameter is used to define what to do if the step is executed.Quit reporting a failure (2), go to the next step (3) and finally, go to an specific You can quit the job reporting success (value equal to 1), ![]() parameter is used to define what to do if the step isĮxecuted successfully.The CmdExec, Distribution, Snapshot, LogReader, Merge, ANALYSISQUERY, ANALYSISCOMMAND, The parameter is used to define the job action. Some other parameters than can be useful for the sp_add_job_step stored procedure Some additional parameters for the sp_add_job_step For this parameter we createdĪutomatic cleanup of SQL Server Agent scheduled jobs.įor more information about the sp_add_job, go to the next steps section. We can delete the job afterĪ successful or a failure or even after completion. Means that the job will not be deleted after execution. parameter indicates if the job will be deleted.Select category_id, name from dbo.syscategories The find theĬategory ID and the category name, use the following query: You can use the category id instead of using the category name. The following example will start the job at step 3. YouĬan decide which one is the first step in the job with this parameter. Sometimes, we do not start the job in step 1, but we start at another step. This parameter is used to describe the job itself. Is a best practice to add a good explanation of what the job does. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |