LIKE (Wild Card) Functionality in Conditional Split Transformation

  • Hi,

    I have some problem in Conditional Split Task in SSIS.

    Suppose, I want to find the customers whose name starts with "ab" then I can use the SQL Query like this " SELECT * FROM Customers WHERE ContactName LIKE "ab%". But I have to use the Stored Procedure as a OLE DB Data Source. I have the permission to use the Stored Procedure but I cann't edit the Stored Procedure.

    But in the Conditional Split Transformation in SSIS, it doesn't support the LIKE functions.I want to manipulate the same logic in Conditional Split Task. I want to filter those records whose name starts with "ab" in Conditional Split Trasnformation.

    Please help me as soon as possible.

  • use SUBSTRING function

    SUBSTRING(name,2,2) = 'ab'

    Hope it will work out...

    Thanks!

  • The substring functio should be:

    SUBSTRING(name,1,2) = "ab"

    In a more general way the FINDSTRING function might be usefull:

    FINDSTRING(name, "ab", 1) == 0

    You can also use the LEFT function in this case.

  • Thanks ...

    Its work out.

    Thank you very much,....

    Regards,

    Ketan

  • xanthos (9/1/2008)


    The substring functio should be:

    SUBSTRING(name,1,2) = "ab"

    Actually, the substring function should be SUBSTRING(name,1,2) == "ab".

    If you use a single = sign, SSIS assumes you are assigning a value to something. == is the true conditional test of whether or not something equals another value.

    Good catch on the single quote problem of the previous poster.

    EDIT: I know this is an old thread, but I added my bit in here in case anyone else comes across this thread in a GOOGLE search and tries to use the solution in their package.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • findstring(character expression,string,occurance)!=-1

    wat does the condition specifies here.

  • banu2316 (2/7/2012)


    findstring(character expression,string,occurance)!=-1

    wat does the condition specifies here.

    That's a tautology (aka always true).

    -1 is never returned by the findstring function, so this expression always yields true.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (2/8/2012)


    banu2316 (2/7/2012)


    findstring(character expression,string,occurance)!=-1

    wat does the condition specifies here.

    That's a tautology (aka always true).

    -1 is never returned by the findstring function, so this expression always yields true.

    Actually, I think you might be thinking of the word truism.

    Tautology is where you say the same thing twice when once is enough - eg, any sentence containing "and also" or "opening gambit."

    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 (2/8/2012)


    Koen Verbeeck (2/8/2012)


    banu2316 (2/7/2012)


    findstring(character expression,string,occurance)!=-1

    wat does the condition specifies here.

    That's a tautology (aka always true).

    -1 is never returned by the findstring function, so this expression always yields true.

    Actually, I think you might be thinking of the word truism.

    Tautology is where you say the same thing twice when once is enough - eg, any sentence containing "and also" or "opening gambit."

    You are referring to the rhetoric tautology, I'm referring to the logic tautology.

    a tautology is a formula which is true in every possible interpretation

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Koen Verbeeck (2/8/2012)


    Phil Parkin (2/8/2012)


    Koen Verbeeck (2/8/2012)


    banu2316 (2/7/2012)


    findstring(character expression,string,occurance)!=-1

    wat does the condition specifies here.

    That's a tautology (aka always true).

    -1 is never returned by the findstring function, so this expression always yields true.

    Actually, I think you might be thinking of the word truism.

    Tautology is where you say the same thing twice when once is enough - eg, any sentence containing "and also" or "opening gambit."

    You are referring to the rhetoric tautology, I'm referring to the logic tautology.

    a tautology is a formula which is true in every possible interpretation

    The day has just begun (coffee #1!) and I've learned something new - thanks!

    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.

  • And I learnt about truism! :w00t:

    (yes dear OP, we are spamming your mailbox with useless notifications :-D)

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 11 posts - 1 through 10 (of 10 total)

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