Solved

Controlling the flow in SQL Server Agent

Posted on 2016-08-23
1
25 Views
Last Modified: 2016-08-23
I have a SQL Server Agent job with 3 tasks.  Task 1 and task 3 will always run.  Task 2 will only run if the count of records in a specific table = 0.  How can I set up the steps to allow this?
0
Comment
Question by:thoecherl
1 Comment
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 41767725
You can't, as SQL Server Agent does not handle conditional step logic as you have described.

A workaround would be to edit the Stored Procedure / SSIS package that is called by Step 2 to test for the 'count of records in a specific table > 0', if yes do everything currently in Step 2, if no then exit.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now