UPDATE QE
SET QE.LockGuid = '8e4031b4906a425ab883e30fbfff890a', QE.QueueState = 1, QE.ExecTime = getdate()
FROM RB_Ebay_Listing_Queue_V2 QE
WHERE QE.QueueID IN (
select top (50) Q.QueueID
FROM RB_Ebay_Listing_Queue_V2 Q WITH (NOLOCK)
INNER JOIN RB_Ebay_Listing_Basic_V2 B WITH (NOLOCK)
ON B.CustomerID = Q.CustomerID
AND B.ListingBasicID = Q.ListingBasicID
AND B.OrderSourceID = Q.OrderSourceID
AND B.SiteCode = Q.SiteCode
LEFT JOIN RB_Ebay_Listing_Product_V2 P WITH (NOLOCK)
ON Q.ListingBasicID = P.ListingBasicID
AND Q.CustomerID = P.CustomerID
AND P.OrderSourceID = Q.OrderSourceID
AND Q.SiteCode = P.SiteCode
AND P.IsVariation = 0
LEFT JOIN RB_OrderSource OS WITH (NOLOCK)
ON OS.ID = Q.OrderSourceID
AND OS.CustomerID = Q.CustomerID
建议增大调用间隔时间。

1.问题分析,
批量更新50条记录;死锁应该是并发产生的,
查询下面的语句很快,1秒内查询出结果
2. 解决方案:
提高数据库性能的情况下,可以根据情况减少批量更新的量
select QE.LockGuid, QE.QueueState, QE.ExecTime
FROM RB_Ebay_Listing_Queue_V2 QE
WHERE QE.QueueID IN
(
select top (50) Q.QueueID
FROM RB_Ebay_Listing_Queue_V2 Q WITH (NOLOCK)
INNER JOIN RB_Ebay_Listing_Basic_V2 B WITH (NOLOCK)
ON B.CustomerID = Q.CustomerID
AND B.ListingBasicID = Q.ListingBasicID
AND B.OrderSourceID = Q.OrderSourceID
AND B.SiteCode = Q.SiteCode
LEFT JOIN RB_Ebay_Listing_Product_V2 P WITH (NOLOCK)
ON Q.ListingBasicID = P.ListingBasicID
AND Q.CustomerID = P.CustomerID
AND P.OrderSourceID = Q.OrderSourceID
AND Q.SiteCode = P.SiteCode
AND P.IsVariation = 0
LEFT JOIN RB_OrderSource OS WITH (NOLOCK)
ON OS.ID = Q.OrderSourceID
AND OS.CustomerID = Q.CustomerID)