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.
| Author |
Topic |
|
inbs
Aged Yak Warrior
860 Posts |
Posted - 2009-02-24 : 02:22:06
|
| i have 3 queries:sum is numericnum is decimal1.UPDATE Table_ASET sum=sum*numFROM Table_A a JOIN TABLE_B bon a.date=b.date and a.currency=b.currencyWHERE company='COM'2.UPDATE Table_ASET coin=sum/numFROM Table_A a JOIN TABLE_B bon a.date=b.date and a.currency='USD'WHERE company='COM'3.UPDATE Table_ASET coin=sum/numFROM Table_A a JOIN TABLE_B bon a.date=b.date and a.currency='EURO'WHERE company='COM'the problem is that qury take so long time i mean:every day it take a 3 minutes (i have 850,000 rows)in weekend it takes a 4 hours (i have 2,500,000 rows)where is the problem? |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-02-24 : 04:25:31
|
It is just a suspicion, but try to use the ALIAS like this:UPDATE aSET sum=sum*numFROM Table_A a JOIN TABLE_B bon a.date=b.date and a.currency=b.currencyWHERE company='COM' No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-24 : 10:17:44
|
| did you had a look at execution plan for query? |
 |
|
|
|
|
|