On table "A" depend about 30 other tables via FK to "A.Id".
For integration testing I have to drop the table and recreate it to create a defined state. Because of the dependent objects their seem to be no way to delete and recreate the table. The error message is:
Could not drop object 'dbo.A' because it is referenced by a FOREIGN KEY constraint
Question(s):
- How can I drop and recreate table "A"?
- (or) is there any way turn the schema dependencies off globally?
- (or) is there any way to backup (all!) dependencies before deleting and restoring table "A" and restore all dependencies afterward?