?
Solved

Controlling the flow in SQL Server Agent

Posted on 2016-08-23
1
Medium Priority
?
42 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 66

Accepted Solution

by:
Jim Horn earned 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

765 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