There are many reasons for me to blog. One of the less vain is to recover and reuse code I wrote earlier. In my current project we have a need to test, test and retest the initial load of the data warehouse.
For this purpose I wrote this T-SQL script that:
- Drops all foreign key constraints;
- Truncates all the tables;
- Recreates all foreign key constraints. I dropped earlier.