• Evil Kraig F (5/15/2012)


    Alone (5/15/2012)


    How to change non clustered index scan to non clustered index seek?The concerned tables already have non clustered index configured.

    Typically? You don't. A seek happens when the data and the filter are selective enough. To get close to guaranteeing a seek you'd need a filter roughly on par with a single day in a year, with even distribution. Even then it would depend on how the index is setup and what your where clause looked like.

    After that you're dealing with data volume and tipping points and row width and a number of other factors.

    Schema, Actual Execution Plan, and the T-SQL would help us help you here.

    Gosh... if all that were true, it wouldn't be worth having things like calendar tables.

    --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)