Qry Performance

  • Also tried taking NOT LIKE off the query and executed but still the same time.

    is there any other way i can query to get the same result ?

  • Ok. After trying to execute the query by part only this part of the query is taking too long

    empcode between '99201' and '99205' or empcode between '99211' and '99215' or

    empcode between '99241' and '99245' or empcode between '99354' and '99355' or

    empcode between '99381' and '99406' or empcode between '90804' and '90815' or

    if there is a way to tweak this part and get the sme result that would help.

  • Sure... turn those ranges of EmpCodes into a single derived table with a single column of all the EmpCodes and use WHERE EXISTS or an INNER JOIN. It will also take care of your "IN" for EmpCodes as well.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 3 posts - 16 through 17 (of 17 total)

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