Solved

Testing for records and if found execute next task using SSIS

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

My client sends a request to me that they want me to load data, which will be returned by Web Service APIs, and do some transformation before importing to database. In this article, I will provide an approach to load data with Web Service Task and X…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
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

789 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