• Jorge,

    This is great stuff!

    However, it seems as though the restore portion does not correctly restore relationships that are based on more than one column.

    I think there needs to be a loop in the dynamic sql section that will iterate through the values in the sysforeignkeys.keyno field. You capture that data in the first part, but do not appear to use it in the restore process.

    If I am incorrect, my sincerest apologies. I ask only because I would hate to lose the multi-column FK relationships on my databases!

    -Dave