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 |
|
satish.gorijala
Posting Yak Master
182 Posts |
Posted - 2009-02-05 : 05:40:00
|
| I have 2 tables. First table cantain 115 columns and 25 million records. second table contains 78 columns and 30 million recordsBoth tables have two common columns.I have written update query to update all columns of first table when data match.. The problem is Query is running more than 5 hrs. How long it will run. Will it runing correctly?Update t2 Sett2.THAI = t1.THAI,t2.VIET = t1.VIET,t2.POLY = t1.POLY,t2.HAWA = t1.HAWA,t2.SAMO = t1.SAMO.............t1.col115 = t1.col115FROM CountryOrigin As t2INNER JOIN Asian_Final AS t1 ON t1.Zipcode = t2.Zipcode AND t1.Zip4 = t2.Zip4G. Satish |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-02-05 : 05:42:03
|
The query will be faster if both ZipCode and Zip4 is properly indexed. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-02-05 : 06:11:10
|
quote: Originally posted by satish.gorijala I have 2 tables. First table cantain 115 columns and 25 million records. second table contains 78 columns and 30 million recordsBoth tables have two common columns.I have written update query to update all columns of first table when data match.. The problem is Query is running more than 5 hrs. How long it will run. Will it runing correctly?Update t2 Sett2.THAI = t1.THAI,t2.VIET = t1.VIET,t2.POLY = t1.POLY,t2.HAWA = t1.HAWA,t2.SAMO = t1.SAMO.............t1.col115 = t1.col115FROM CountryOrigin As t2INNER JOIN Asian_Final AS t1 ON t1.Zipcode = t2.Zipcode AND t1.Zip4 = t2.Zip4G. Satish
u cannot update asian_final t1 table |
 |
|
|
satish.gorijala
Posting Yak Master
182 Posts |
Posted - 2009-02-05 : 06:26:02
|
When i am typing by mistake i typed t1.col115 = t1.col115, but it is t2.col115=t1.col115. I am updating the countryorigin table here.quote: Originally posted by bklr
quote: Originally posted by satish.gorijala I have 2 tables. First table cantain 115 columns and 25 million records. second table contains 78 columns and 30 million recordsBoth tables have two common columns.I have written update query to update all columns of first table when data match.. The problem is Query is running more than 5 hrs. How long it will run. Will it runing correctly?Update t2 Sett2.THAI = t1.THAI,t2.VIET = t1.VIET,t2.POLY = t1.POLY,t2.HAWA = t1.HAWA,t2.SAMO = t1.SAMO.............t1.col115 = t1.col115FROM CountryOrigin As t2INNER JOIN Asian_Final AS t1 ON t1.Zipcode = t2.Zipcode AND t1.Zip4 = t2.Zip4G. Satish
u cannot update asian_final t1 table
G. Satish |
 |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-02-05 : 06:42:59
|
| k fine satish enjoy... |
 |
|
|
|
|
|
|
|