I have a .csv file with several hundred million records that I have imported into a SQL Server table. In an attempt to normalize the data, I have created several sub tables that contain ID for several respective values contained in the main table. I am looking to update the values in the main table with their respective ID’s from the sub tables, but I am unsure of how to accomplish this.
As a small example of what I am trying to accomplish:
Table 1 contains FName, LName, Address, City, State, Zip, etc
Table 2 contains CityID, StateID, etc
I want to look for any value for City in Table 1 that equals 'Chicago', reference table 2 with the appropriate CityID for Chicago, and update Table1 with the matching CityID
As a small example of what I am trying to accomplish:
Table 1 contains FName, LName, Address, City, State, Zip, etc
Table 2 contains CityID, StateID, etc
I want to look for any value for City in Table 1 that equals 'Chicago', reference table 2 with the appropriate CityID for Chicago, and update Table1 with the matching CityID