I'm importing data from a legacy application (php + mysql) to a rewritten version (sql server 2008 and mvc3). I'm currently in the middle of writing a db synchronization / conversion package.
The mysql data has primary keys but no foreign keys for some reason and because the data is still relational (despite the lack of foreign keys) my conversion package is using IDENTITY_INSERT ON / OFF. Because the source data has no way of enforcing data integrity I would like to perform integrity check after I perform an insert and turn IDENTITY_INSERT to OFF.
Is there a good way to script that action? Preferably on a table level rather than whole db?
Thanks.