Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 15264

SIU locks during select

$
0
0

We have found deadlocks in our application. Deadlocks occure between SELECT and UPDATE. I get deadlock graph using profiler and find that SELECT makes SIU lock. Below you'll find SELECT statement:

select

t1.*

    from MyTable t1

    --self join on field1 and field2

        leftouterjoin

            (select field1, field2

                from MyTable

                where field3 notin( 0, 1 )

                    or field3 = 0 and field4 isnotnull) t2

        on t1.field1 = t2.field1 and t1.field2 = t2.field2

    where

        t2

.field1 isnull--only records which were not found

        and t1.field4 isnulland t1.field3 = 0

        and t1.field5 in(0,1)

 Why SIU lock is set?

Viewing all articles
Browse latest Browse all 15264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>