December 26, 2013 at 5:19 am
Hi,
I have 5-6 Update SQL within a Procedure. These Update SQL are 3-4 liner and are updating Columns based on some other Column in same table and some are based on join.
eg.
1. UPDATE Customer SET PhoneNumber='N/A' WHERE PhoneNumber=''
2. UPDATE Customer SET Salary=sa.Salary FROM Customer cust JOIN Salary sa ON cust.CustomerID=Sa.CustomerID
These update are taking very long time to complete in Procedure, approx 15 minutes. Where as if i execute them separately it takes only 2-3 minutes.
What could be reason?
Any thoughts appreciated.
Thanks,
Anupam
December 26, 2013 at 5:48 am
anupamk (12/26/2013)
Hi,I have 5-6 Update SQL within a Procedure. These Update SQL are 3-4 liner and are updating Columns based on some other Column in same table and some are based on join.
eg.
1. UPDATE Customer SET PhoneNumber='N/A' WHERE PhoneNumber=''
2. UPDATE Customer SET Salary=sa.Salary FROM Customer cust JOIN Salary sa ON cust.CustomerID=Sa.CustomerID
These update are taking very long time to complete in Procedure, approx 15 minutes. Where as if i execute them separately it takes only 2-3 minutes.
What could be reason?
Any thoughts appreciated.
Thanks,
Anupam
Large rowcount, little memory.
Blocking.
Lack of indexes.
Too many indexes.
Etc.
Etc.
There are dozens of possible reasons. Please see the second link under "Helpful Links" in my signature line below if you want help with specific queries.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply