﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 Administration  / Strange blocking issue / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 07:47:33 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Strange blocking issue</title><link>http://www.sqlservercentral.com/Forums/Topic1395009-1550-1.aspx</link><description>Thanks SQLACT &amp; Anthony for the reply.Will check those and update you guys</description><pubDate>Tue, 11 Dec 2012 05:19:08 GMT</pubDate><dc:creator>Ratheesh.K.Nair</dc:creator></item><item><title>RE: Strange blocking issue</title><link>http://www.sqlservercentral.com/Forums/Topic1395009-1550-1.aspx</link><description>Hi,Check sp_whoisactive procedure after running the above statements. It will tell you which session id is blocing the table.  ORU can check the information sys.dm_tran_locks to see if there are any shared and exclusive locks on it. For more information goto Adam machanic blog. http://sqlblog.com/blogs/adam_machanic/archive/tags/sp_5F00_whoisactive/default.aspx</description><pubDate>Tue, 11 Dec 2012 05:17:47 GMT</pubDate><dc:creator>sankar276</dc:creator></item><item><title>RE: Strange blocking issue</title><link>http://www.sqlservercentral.com/Forums/Topic1395009-1550-1.aspx</link><description>The delete must have been waiting for the bulk insert to release a lock on some resource it had held open.If you have historic reporting, try looking at what locks where held for the bulk insert, or debug where both of the statements could execute at the same time for transactional concurency and things not committing transactions where they should etc.</description><pubDate>Tue, 11 Dec 2012 04:55:39 GMT</pubDate><dc:creator>anthony.green</dc:creator></item><item><title>RE: Strange blocking issue</title><link>http://www.sqlservercentral.com/Forums/Topic1395009-1550-1.aspx</link><description>Any chance of referential integrity between these 2 tables?</description><pubDate>Tue, 11 Dec 2012 04:52:29 GMT</pubDate><dc:creator>SQLSACT</dc:creator></item><item><title>Strange blocking issue</title><link>http://www.sqlservercentral.com/Forums/Topic1395009-1550-1.aspx</link><description>Hi Experts,I came across a blocking issue in which the below two process are involved the second statement is blocked by first,but the strange part is they don't have anything in commoninsert bulk [dbo].[table1]([MeterReadID] uniqueidentifier,[MeterID] uniqueidentifier,[AssetID] uniqueidentifier,[EntryDate] datetime,[ReadDate] datetime,[Count] bigint,[UserName] nvarchar(50),[MeterSourceID] uniqueidentifier,[MeterExtendedSourceID] uniqueidentifier,[IsRollOver] bit,[StartRead] bigint,[Comment] nvarchar(50),[IsInvalid] bit,[IsCredit] bit,[Credits] bigint,[IsEstimate] bit,[IsSuspect] bit,[IsSuspectHigh] bit,[IsVirtual] bit,[IsRefill] bit,[RefillCount] bigint,[CreatedDate] datetime,[CreatedBy] uniqueidentifier,[ModifiedDate] datetime,[ModifiedBy] uniqueidentifier,[DWIsDeleted] bit,[DWStartDate] datetime,[DWEndDate] datetime,[IsInstall] bit,[IsFinal] bit)DECLARE @DuplicateRows bigint, @RowsUpdated bigint ;   DELETE c FROM dbo.[table2] AS c INNER JOIN dbo.[table2_Deletes] AS a ON c.[MeterReadID] = a.[_MeterReadID] AND c.DWEndDate = a.[ModifiedDate] ;   SET @DuplicateRows = @@ROWCOUNT ;   UPDATE c SET c.DWEndDate = ISNULL(a.[ModifiedDate], GETDATE()) FROM dbo.[table2] AS c INNER JOIN dbo.[table2_Deletes] AS a ON c.[MeterReadID] = a.[_MeterReadID] WHERE c.DWEndDate IS NULL AND a.IsPruned = 0 ;   SET @RowsUpdated = @@ROWCOUNT ;   DROP TABLE dbo.[table2_Deletes] ;   SELECT @DuplicateRows AS DuplicateRows, @RowsUpdated as RowsUpdated ;The delete statement is blocked by bulk insert. Can anyone please point out why this happened?</description><pubDate>Tue, 11 Dec 2012 03:50:05 GMT</pubDate><dc:creator>Ratheesh.K.Nair</dc:creator></item></channel></rss>