Conditional SSIS Tasks based on a result set?

  • 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

  • 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.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • 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.

  • 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.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • 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?

  • 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!

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply