July 11, 2013 at 10:38 am
i'm trying to resolve a deadlock issue between a SELECT INTO query and an UPDATE query.
UPDATE tableA
SELECT INTO DiffDatabase.dbo.newTable FROM tableA
the UPDATE query has an IX lock on page 1. the SELECT INTO query has a SIU lock on page 2. the UPDATE is requesting an IX lock on page 2, while the SELECT INTO wants a S lock on page 1, thus the deadlock
my question is, why does the SELECT INTO have a SIU lock in the first place?
July 16, 2013 at 4:04 pm
That sounds a little funny. But are those the complete statements? That is, there are no WHERE clauses?
[font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]
July 22, 2013 at 5:51 am
Hi,
It's a typical cycle type deadlock.
Which isolation level do you use?
Regards
IgorMi
Igor Micev,My blog: www.igormicev.com
July 22, 2013 at 9:40 am
all read committed. i fixed the issue with a query rewrite and a new index. thanks for the reply though
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy