Complex Case Conditions eating my query!

  • How do you SQL guru's handle rules in your queries?

    I have about 20 rules to apply to each column in a query to determine it's final value.

    How can I put those rules in table so that if they ever (heaven forbid) decide to add more rules that it is not a complete re-write on the queries.

    Essentially, I need to match names. Thankfully I am always guaranteed last name and gender match.

    but for First names and Middle names there are many different rules that have to be processed.

    What is the best way to apply rule processing to queries?

    Or maybe how do I apply rules to just a result set, instead of doing a CASE statement 20 times on each column.

    Thanks,

    Christopher Ford

  • Christopher Ford (9/23/2008)


    How do you SQL guru's handle rules in your queries?

    I have about 20 rules to apply to each column in a query to determine it's final value.

    How can I put those rules in table so that if they ever (heaven forbid) decide to add more rules that it is not a complete re-write on the queries.

    Essentially, I need to match names. Thankfully I am always guaranteed last name and gender match.

    but for First names and Middle names there are many different rules that have to be processed.

    What is the best way to apply rule processing to queries?

    Or maybe how do I apply rules to just a result set, instead of doing a CASE statement 20 times on each column.

    Thanks,

    The safe answer boils down to...................................................

    ............................................................................................

    .................. (you know it's coming) ..........................................

    ............................................................................................

    It depends. There are lots of ways to express criteria, and what might work best in one scenario might not in the next.

    Perhaps we should start with an example. Do you have something you might mock up? or failing that - just simply describe the process in English?

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 2 posts - 1 through 1 (of 1 total)

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