Welcome to EMC Consulting Blogs Sign in | Join | Help

SSIS Junkie

Once upon a time this blog was a hive of activity. Now however its pretty lifeless as you can probably tell so if are pining for more of the same you can find me over at http://sqlblog.com/blogs/jamie_thomson. I look forward to seeing you there!

SSIS Nugget: Conditional Execution

A question was asked on the SSIS forum about conditional execution. The questioner had a data-flow that checked some incoming values and, depending on cetain characteristics, could identify that row as being "bad". (S)he then wanted to do some action (in this case send a mail) if the number of bad rows exceeded 0.

Conditional execution is what is needed to accomplish this - namely expressions on our precedence constaints. The steps are to:

1) Use the rowcount component to capture the number of bad rows

2) Populate a variable with the number of bad rows

3) Check the value of a the variable in a precedence constraint. if it is greater than 0, do the action.

I have put together a little demo of this that may prove useful. I have used a script task to display a message box for the "action" rather than sending a mail. It can be downloaded from here: http://blogs.conchango.com/Admin/ImageGallery/blogs.conchango.com/jamie.thomson/20050725ConditionalExecution.zip.

-Jamie

Published 25 July 2005 12:52 by jamie.thomson

Comments

 

Jamie Thomson's Blog said:

I hate commuting. There's no two ways of saying it, I despise it. Every day I face the 70 minute grind...
July 25, 2005 16:10
 

Jamie Thomson - Life, the universe and SSIS! said:

I hate commuting. There's no two ways of saying it, I despise it. Every day I face the 70 minute grind...
July 27, 2005 16:04
 

Thank you said:

Your site is realy very interesting.
February 22, 2006 21:50
 

Jamie said:

You have some great stuff here - keep it up.

You're turning me into an expression expert.

May 13, 2008 15:58
New Comments to this post are disabled

This Blog

Syndication

Powered by Community Server (Personal Edition), by Telligent Systems