Today I learnt something new. I personally think it is healthy to learn something new every single day; and when it is something you learn about something you didn't think there was anything left to learn about, then it feels so much nicer!
I am not making sense, so allow me to explain....
I was faced today with having to restore a number of tables from backup tables.
The tables use the exact same schema (the backup tables do actually have some additional columns which I wont go into here as it isn't relevant), so a restore would be simple, just move the data out of one table into another; and repeat for all the tables that needed to be restored.
So I wrote a script to accomplish the task. I quickly realised to preserve relationships in the tables, I would have to insert the row identities to the tables. S...
More…