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 wheret2
.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?