Avatar of Auerelio Vasquez
Auerelio Vasquez
Flag 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.
Microsoft SQL ServerMicrosoft DevelopmentMicrosoft SQL Server 2008

Avatar of undefined
Last Comment
Alpesh Patel

8/22/2022 - Mon
Auerelio Vasquez

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
8080_Diver

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
G Trurab Khan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Auerelio Vasquez

ASKER
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.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Auerelio Vasquez

ASKER
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
8080_Diver

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Alpesh Patel