SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Conditional SSIS Tasks based on a result set?


Conditional SSIS Tasks based on a result set?

Author
Message
CptCrusty1
CptCrusty1
Old Hand
Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)

Group: General Forum Members
Points: 316 Visits: 387
I have a source table with data that could go to multiple sources. For example, Apples, Oranges, Kumquats. I could write an Execute SQL Container to push the Apples to the Apples table. But each week, there may or may not be data for Apples in the source. I could write a script that only executes the sql if the records are there, but I wondered if there is SSIS way I could check and then skip the Data Flow task if there is no data to flow....

Does that make Sense?


Crusty
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18497 Visits: 20439
Have you checked out the Conditional Split transformation? It allows you to redirect data based on tests such as these, so you could split your input into multiple streams, with each stream going to a different output.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
CptCrusty1
CptCrusty1
Old Hand
Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)

Group: General Forum Members
Points: 316 Visits: 387
Phil,

As always, thanks for your input, or.... Conditional Input... BUAH!!! LOL...

I checked this out and its totally cool; however, I have another question (just like a 6 y/o).. My conditional Column from the source table is called "Fruit" for this example. If the Condition says Fruit == "Apple" and I add my OLD DB Destination based on Apple, if there is no "Apple" Data to push, will the OLE DB Destination container fire off? If so, that's wasted processing time which I want to avoid. I have to do this 13 times. The Data Access Mode will be an SQL Command that queries the landing table with the source table to make sure no duplicates are pushed. The landing table is REALLY large in all cases and I need to limit how often/how long that table is getting hit as it has a direct impact on customers.

Also... I know this is stupid but why... why why why do we use single quotes to enclose a string everywhere else in SSMS, but in the conditional split conditions we use double quotes?

again... thanks for the assists... you always help if you can.

Crusty.
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18497 Visits: 20439
If no data is pushed along the output, the output will do no work. That is not to say that it won't be validated when the package fires, so there is a small overhead in having so many paths.

A possible problem for you is where your input file suddenly contains durians and kumquats and you have not built the conditions for directing these new fruits into your conditional split. If you need this type of dynamic processing, a different approach is required.

Regarding the double quotes - it's because SSIS is not based on T-SQL. The SSIS expression language is more like C# with some SQL-like functions added in. C# uses double quotes for string literals.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
CptCrusty1
CptCrusty1
Old Hand
Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)Old Hand (316 reputation)

Group: General Forum Members
Points: 316 Visits: 387
Phil Parkin (4/23/2013)

A possible problem for you is where your input file suddenly contains durians and kumquats and you have not built the conditions for directing these new fruits into your conditional split. If you need this type of dynamic processing, a different approach is required.
.


YES! I knew you would see that. Durians, huh? Wow do they stink! Either way. The "Fruit" table is provided to us by a keying crew somewhere in Bangalore, India, thus if we get Durians, it's because we asked for it. If we got them without asking for it, there is a bigger problem. On that note, the team over there is pretty good.


Regarding the double quotes - it's because SSIS is not based on T-SQL. The SSIS expression language is more like C# with some SQL-like functions added in. C# uses double quotes for string literals


I thought it smelled like C something....ahhh... college days... that was a long time ago.


Ok. So I'll give it a shot and see what I get.

Thanks again, Dude.

P.S.... Did you know that Durians are outlawed on pubic transportation in some of the countries they are grown/imported?
Phil Parkin
Phil Parkin
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18497 Visits: 20439
P.S.... Did you know that Durians are outlawed on pubic transportation in some of the countries they are grown/imported?


Yep - with good reason too. I can't get near enough to one to ever consider tasting it!


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search