I do have two tables:
1. PersonAddressList [About 5,000 records]
Columns:
ID int
TITLE varchar
CITY varchar
2. CityList [About 5,000 recods]
Columns:
ID int
City_Name varchar
City_State int //[RK to State]
Previous designer had added city names directly in table 1 [personaddresslist]. Now I am normalising it and replacing the city name in table 1 with city id in table 2
Query I have used:
Update personaddresslist, CityList set CITY = cityList.ID where CITY = City_name
The above query runs good if the tables have less data, but keeps on rolling n rolling in case of both tables has large no of data. In my real scenario I do medium set of data about 5000 records in each table.
So how do can we tune it fine.
Regards, Kabindra
Edit 1: Regarding the result from above query, it took me nearly 40 mins to complete the running of script, Since I need to run the similar script on other more tables, I would like to fine tune and make it faster.