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
35 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
Comment Utility
>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
Comment Utility
thanks i have added this in the Control Flow.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
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…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

744 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

8 Experts available now in Live!

Get 1:1 Help Now