• 456789psw - Wednesday, May 16, 2018 7:17 AM

    Solved!

    <SyncPoint> is an indication of an Exchange event. If you run profiler trace with deadlock graph it will clearly show its and exchange dead lock( intra-query parallelism deadlocks). Add MAXDOP 1 and the issue will be resolved

    Not solved.  You found a "patch".  The use of "DISTINCT" is still a problem and indicates that the criteria is insufficient to prevent duplication of rows.  Solve that and get the amount of time and resources being used by the query down and that will be the beginning of a true solution.

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