Then to add the data, you could do a join with cities table.
UPDATE
Employees
SET
Cityid = C.CityID
FROM
Employees E
INNER JOIN Cities C
ON E.city = C.city
Then, removing the city column should be as simple as alter table remove column.|||
The following simplified version also works:
UPDATE Employees
SET Cityid = C.CityID
FROM Cities C
WHERE Employees.City = C.City
No comments:
Post a Comment