Solved

Controlling the flow in SQL Server Agent

Posted on 2016-08-23
1
20 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

759 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

18 Experts available now in Live!

Get 1:1 Help Now