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
Solved

How to stop data flow SSIS when there is a lookup match output and carry on when No Match Output

Posted on 2016-08-22
2
68 Views
Last Modified: 2016-08-22
Hello ,

I have a SSIS package that imports data from spreadsheet into temp table by checking if the data ( year column ) doesn't exist in destination table then will insert data into table. I would like the package to stop if it finds a matching year in destination table.

what the data flow looks like
Excel Source --> Data Conversion --> Lookup --> OLE DB Destination


Kind regards
0
Comment
Question by:deanmachine333
2 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 41765211
>I would like the package to stop if it finds a matching year in destination table.
I'm not aware of any control that does a 'Stop the package if this expression happens', so what you could do is

  • Add a Row Count control after the lookup, assigning that row count to a variable (e.g. your_variable)
  • Add a precedence constraint (aka green arrow) immediately after the data flow task in question,with an expression of something like @[your_variable} == 0, which would mean that processing would only continue if that variable contained a zero.
0
 

Author Closing Comment

by:deanmachine333
ID: 41765241
thanks i have added this in the Control Flow.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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…

839 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