Why does a select on 1 table end up putting locks on other tables?

  • Tobar wrote:

    From what I read, and think I understood, this code is creating a watchdog that looks for SQL statements that contain the "Having" clause. When it sees that clause, it checks for tables with locks. I am wondering if I forgot a piece. I thought it was more obvious that the "having" clause was being searched for.

    "Having"?  Your original question was talking about a simple SELECT hitting on 4 tables.  How would your extended events find such a simple SELECT, which probably doesn't even have a "Having" in it.

    I'm confused.  I'm going to my room to talk with the dust-bunnies. 😀

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

  • @tobar... did you ever figure this out?  Without being able to put my hands on the database, I'm out of suggestions.

    --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 2 posts - 16 through 16 (of 16 total)

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