Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 update query

Author  Topic 

ajith_ad
Starting Member

3 Posts

Posted - 2012-03-20 : 01:40:59
I am using the following update query in SP. But this query is taking long time to execute . Is there any way to tune this? PS_ARB_OB_CHG_SUM and PS_ARB_OB_SKU_REPO REPO contains huge records


Update PS_ARB_OB_CHG_SUM
Set PROCESSED_FLG ='IGNR',
PROCESS_DTTM = getdate()
from PS_ARB_OB_CHG_SUM PACS
Inner Join PS_ARB_OB_CHG_TMP TMP ON PACS.PMI_MESSAGE_ID = TMP.PMI_MESSAGE_ID
WHERE
PACS.PROCESSED_FLG= 'N' And
NOT Exists
(Select 'X' from PS_ARB_OB_SKU_REPO REPO
Where ( TMP.PMI_MESSAGE_ID = REPO.ARB_CREATED_MSG_ID
OR TMP.PMI_MESSAGE_ID = REPO.ARB_LASTUPD_MSG_ID
OR TMP.PMI_MESSAGE_ID = REPO.ARB_HOLD_MSG_ID))

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-20 : 16:05:41
what all indexes you've on table?
start with analysing execution plan

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -