Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Deadlock via SELECT INTO query getting a SIU lock Expand / Collapse
Author
Message
Posted Thursday, July 11, 2013 10:38 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 18, 2014 9:46 AM
Points: 4, Visits: 42
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?
Post #1472698
Posted Tuesday, July 16, 2013 4:04 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Wednesday, July 23, 2014 2:28 PM
Points: 786, Visits: 691
That sounds a little funny. But are those the complete statements? That is, there are no WHERE clauses?

Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Post #1474324
Posted Monday, July 22, 2013 5:51 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 28, 2014 4:35 AM
Points: 2,901, Visits: 2,927
Hi,

It's a typical cycle type deadlock.
Which isolation level do you use?

Regards
IgorMi




Igor Micev,
SQL Server developer at Seavus
www.seavus.com
Post #1475961
Posted Monday, July 22, 2013 9:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 18, 2014 9:46 AM
Points: 4, Visits: 42
all read committed. i fixed the issue with a query rewrite and a new index. thanks for the reply though
Post #1476088
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse