Query optimization

  • Yep... "Read Committed" is the default on most of the other editions (At least Standard, Enterprise, and Developer's Editions... dunno about the others). Thanks for the tip on the Compact Edition...

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

  • You can use ISDATE() function to handle NULL values instead of using ISNULL

    SELECT user_key User_id, update_date createDate

    FROM accounting.dbo.user

    WHERE user_key NOT IN

    (

    SELECT DISTINCT CONVERT(INT, RIGHT(vendor, LEN(vendor)-1)) user_key

    FROM Prod.dbo.return_vendors)

    AND ISDATE(update_date)=1

    AND update_date <= GETDATE() - 1

    )

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

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