• Thanks very much for your help so far!

    I'm at home now so I haven't got access to SSMS, but I've read through your code and I think I can see what's going on. The bit I'm unsure about is you have new and legacy tables with data going between them. This could be just to illustrate your point, which is fine in that case.

    But let me just focus down on to the crux of the problem. I've ommitted all the other fields - just the ones to to with the IDs are left.

    Table before migration

    QuestionID ParentQuestionId

    ---------- ----------------

    1 NULL

    Table after migration

    QuestionID ParentQuestionId

    ---------- ----------------

    1 7

    7 NULL

    So what the migration has done is:-

    (a) Insert a new record (this happens to be a copy of #1)

    (b) Updated #1 to point to #7

    And what I'm trying to find out on this forum is:-

    (*) Will I have to cursor through the table, and process each record ... or is their an alternative?

    This is awful, repeated, redundant data, that's for sure. Sadly the database is being a bit of a victim here to allow the software changes to go through without us having many weeks of Developer time to do it properly. We're having to do it this way to limit that amount of the system that needs code changes and testing.