Solved

Testing for records and if found execute next task using SSIS

Posted on 2013-06-24
5
216 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
I have a large data set and a SSIS package. How can I load this file in multi threading?
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 UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

910 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

17 Experts available now in Live!

Get 1:1 Help Now