I have a table structure with columns like this
- [ID]
- [Name]
- [ParentId]
- [ParentName]
The parents are contained in the same table, and i would like to populate the parent name column using a statement like:
UPDATE Table
SET ParentName = (select Name
from Table
where Id = ParentId)
When i do this, all the ParentNames are set to null. Thoughts?