Playing around with SQL Server 2008 and I have a table People with columns:
Name | City | Born | ...
and another table Change with columns:
OldName | NewName
Now I would like to change Name in the table People something like this: if there is the same OldName in table Change as the Name in People then change the Name in People to the NewName in Change.
Any easy way?
Oh and another question to this: if the Name in People would be the primary key (or let say Name and City would be composite key), would it be much harder to change the name? Thx
Answer1)
EDIT with inner Join syntax:
I don’t have a SQL Server to test that on, but based on online examples, it should work.
/Edit
Answer2) As long as you still maintain uniqueness in the key it wouldn’t be difficult to change at all. As soon as you cause a collision you would get an error. For this reason it would be best to have an auto-incrementing ID field in people that would be your PK