Can insert cause a deadlock?

  • I am inserting 52000 records to the table and this select statment is showing SQL Deadlock,can insert cause a dedlock?

    SELECT A.ProductID FROM Base_CatalogProducts A INNER JOIN ext_ProductClass B ON A.ProductID = B.ProductCode WHERE (A.DesignGroup = 'ST269') AND (A.DefinitionName = 'PersonalizedProduct') AND (A.IsActive = 'Y') AND (B.PriceClass = 'FREELBL')

  • Yes, an INSERT can indeed be involved in a deadlock if another transaction either has or requires an exclusive lock on the object in question i.e. a particular data page.

  • There is no exclusive lock

  • Insert needs an Exclusive lock and the Select might be dead locking with this insert or vice versa... (Atleast that is what I know)

    -Roy

  • What is the deadlock error message produced from your scenario?

    It will identify for you the resources that are in contention with one another, and the lock types that are both in place and being requested.

    See the Microsoft reference, Detecting and Ending Deadlocks.

    http://msdn.microsoft.com/en-us/library/ms178104.aspx

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply