• javirsantos (9/30/2016)


    I set up a test environment with S2 CU1 patch level and gives the same error, deadlock.

    There's a strong relationship between transaction duration and deadlock occurrence. Speeding up your transaction will reduce the likelihood of a deadlock.

    Check that the permanent table has an index which will support the update, and consider resolving the xml into a #temp table or @table variable as a separate step.

    Posting an actual (as opposed to estimated) execution plan as a .sqlplan attachment will assist folks in tuning the query.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden