I am running a stored procedure that usually takes 45 minutes and now I am cancelling out the job after 3 or 4 hours. I have rebooted the server and I have rebuilt the indexes in most of the tables. When I tried to go though code I found that a typical example of code that is taking hours instead of minutes is :
I have rebiult the indexes on this table imp_worx_ar_process
Any help is greatly appreciated.
I have rebiult the indexes on this table imp_worx_ar_process
Any help is greatly appreciated.
Code:
UPDATE imp_worx_ar_process
SET closedt = cldt.clsdt
FROM imp_worx_ar_process i
INNER JOIN tmp_CloseDts cldt on i.clntid = cldt.clntid AND i.rptpd = cldt.rptpd;