Link to home
Start Free TrialLog in
Avatar of Auerelio Vasquez
Auerelio VasquezFlag for United States of America

asked on

SSIS: Conditional Split

I'm trying to do to conditions:

One, if the incoming table, has duplicate rows or if the value is null in a column, then i want the condition to send an email, if not, then continue with the data transformation.

1. Can i use a query in conditional Split  ? ,
2.  i know one case can be null, but i can't figure out how to express that in the correct syntax.
Avatar of Auerelio Vasquez
Auerelio Vasquez
Flag of United States of America image

ASKER

Basically,

What i'm trying to Do.

if this condition is true or the value of the column (product) is null

then send email task.... Otherwise, move to the next task.

here is the query:

SELECT COUNT(product), product
FROM dbo.imp_ProductExclusionFlag
GROUP BY product
HAVING COUNT(PRODUCT) > 1
Since the approach I usually take is to bring everything into a staging table and then process it into the Production tables, I would simply use a set of 2 or 3 queries to accomplish this.  One (or, possibly 2) would pump the duplicates and NULL containing rows to the exceptions table.  I would then use another one to add the data to the Production table.  (Although, I would probably go ahead and code that last one as either a MERGE query or a set of 3, i.e. an UPDATE, an INSERT, and a DELETE)
ASKER CERTIFIED SOLUTION
Avatar of G Trurab Khan
G Trurab Khan
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes, well i was not able to use a conditional split, i just used the on success and created to additional tasks, and use the logic, if the row count was greater than 0, or if any row was null, to use one path, and if it wasn't true to move to another task.... i still would like to get more information on using conditional splits. thanks for your comments.
i understand how the conditional split works, for each row, it works great, if you are checking a value row by row. However, the resutls of a query is what i'm trying to find out for my second condition.

i guess i could throw the results of a query into a variable, and use a count, if the count is greater than a certain number, i could use that to send the results another way......
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial