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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-10-30 : 08:34:08
|
| Fawad writes "I have two tables with the following structure:Transaction_Detail {PK(Tr_Id,SNo) Clustered} 6,00,000 Rows Tr_ID int, SNo smallint, GSL_Code varchar(5), Dr_Cr bit, GSL_Running_Balance money, GSL_Base_Running_Balance moneyTempTable {PK(Tr_Id,SNo) Clustered} 5,40,000 Rows Tr_ID int , SNo smallint, GSL_Code varchar(5), GSL_Running_Balance money, GSL_Base_Running_Balance moneyPrimary key for the TempTable references Transaction_detail Primary Key. I would like to update columns GSL_Running_balance & GSL_Base_running_balance in the Transaction_Detail table with corresponding values in TempTable. To do so i run the following statement :UPDATE Transaction_DetailSET GSl_Running_Balance = TT.GSl_Running_Balance,GSl_Base_Running_Balance = tt.GSl_Base_Running_BalanceFROM TempTable TT Join Transaction_Detail TDON Tt.Tr_ID = td.Tr_IDAND Tt.SNo = td.SNoThis statement takes about 2 hours to finish. I am wondering as to how to make it work faster and what is it that i am missing.Your help will be truly apperciated.Regards." |
|
|
|
|
|
|
|