sql - long running sp -


the following sp: have stored procedure runs anywhere 1/2 minute 4 hours (during nightly processing):

update tablea set tablea.other_flag_50 = isnull(staging.other_flag_50, 0) tablea inner join (     select acct_nbr,         appl_code,         other_flag_50     tableb ) staging on tablea.lnhist_acct_nbr = staging.acct_nbr     , tablea.lnhist_appl_code = staging.appl_code 

i ran blocking reports in profiler 2 nights in row, first @ 10 minutes interval @ 5 minutes. stored procedure never shows being blocked (but blocks other queries).

any ideas on optimizing this? creating view join help? (acct_nbr, appl_code, other_flag_50 tableb) thanks!!

have tried doing inner join directly tableb?

update tablea  set tablea.other_flag_50=isnull(tableb.other_flag_50,0)  tablea  inner join tableb      on tablea.lnhist_acct_nbr = tableb.acct_nbr       , tablea.lnhist_appl_code = tableb.appl_code 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -