Hello
Following is the example table.
SelfRefTable
Id Name ParentId Year
1 GrandParent null 2013
2 Parent 1 2013
3 Child 2 2013
4 GrandChild 3 2013
Id column is Identity column. ParentId references Id column(Self reference).
Now I want to duplicate above data in the same table with incremented Year.
Following should be the table data after duplication.
SelfRefTable
Id Name ParentId Year
1 GrandParent null 2013
2 Parent 1 2013
3 Child 2 2013
4 GrandChild 3 2013
5 GrandParent null 2014
6 Parent 5 2014
7 Child 6 2014
8 GrandChild 7 2014
Please somebody help me to do this
Thanks in advance
Sanandan