Solved

Testing for records and if found execute next task using SSIS

Posted on 2013-06-24
5
215 Views
Last Modified: 2016-02-11
I use SSIS to perform ETL process and some times the client sends new or unknown files.  I do have a table that captures the unknown file information and have a SP that checks the table at the conclusion of the process.  How can I execute the previous package only if there is a unknown file?  I thought that I would execute a SQL TASK basically doing a coun(*) for any files that appeared today and if > 0 it would flow through the SSIS package that sends me the list of file.  If the value is = 0 then don't execute the next package.

Have I confused you enough?
0
Comment
Question by:wdbates
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39274636
"Have I confused you enough?"

Yes you have...  Could you say that with an image please?

Using the SQL task with a SELECT COUNT(*) is indeed an option.  You could have the single-value result set assigned to a package variable and then use that variable on the precedence constraint (the green connector).  That's for Control Flow.

In case you're in a Data Flow I'd advise to use the Lookup component.  With that you can look up any existing records and split the incoming data according to what's found or not.

Now, did I manage to get you confused? :)
0
 
LVL 37

Accepted Solution

by:
ValentinoV earned 300 total points
ID: 39274647
In addition to previous msg: to edit the precendence constraints, double-click the green connector.  Now change the Evaluation operation to Expression and Constraint.  That allows you to enter an expression like @[MyVariable] == 0
0
 

Author Comment

by:wdbates
ID: 39284564
Sorry for the delay, but been out of the country.  Will check later today if I have time.
0
 

Author Closing Comment

by:wdbates
ID: 39297910
Sorry for the delay, but the solution work!
0
 
LVL 37

Expert Comment

by:ValentinoV
ID: 39298247
Cool! :)
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Here's a requirements document template for an integration project (also known as Extract-Transform-Load or ETL) based on my development experience as an SQL Server Information Services (SSIS) developer over the years.
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.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

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

21 Experts available now in Live!

Get 1:1 Help Now