Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

update getting blocked?

$
0
0

Hi experts,

I have a job that most of the times takes seconds, but sometimes takes 40, 50 minutes to run…

 

I am pretty sure is because of a blocking…

 

The code has a couple of selects and then:

 

updateSF_Opportunity

set         lastopportunitystageID=d.OpportunityStageID,

            LastOpportunityStageUpdateDate =LastOppUpdate,

            LastOpportunityStageInsertDate =LastOppInsert

from  #LastOpportunityDatad

join  SF_Opportunityso

on          d.OpportunityID=so.OpportunityID

where isnull(so.LastOpportunityStageID, 0)<>d.OpportunityStageID

 

 

I suspect this Update gets blocked and sometimes waits for minutes…

 

I am thinking of updating the SP and putting a getdate() before the update and after and save those values to  a table…. So I will confirm is this the root cause… Thoughts?


Viewing all articles
Browse latest Browse all 5123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>