• T.Ashish (5/17/2013)


    Though I know the drawbacks of NOLOCK, it can't be avoided in our case.

    Really? So you absolutely must allow potentially incorrect data in results because ....

    And regarding this post, I know that logically all 3 queries are same, but I'm little confused about how SQL Server is handling the JOINS in these 3 queries!!!

    They're logically the same, so SQL's handling the joins identically. The fact that some are joined in the FROM and others joined in the WHERE doesn't change the query's form nor the way SQL executes them.

    And if it doesn't matters then why I should not use Query 2 or 3 everywhere!!!

    You can if you wish. They're harder to read, easier to make mistakes with and impossible to convert to outer joins, but if you wish you can use them

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass