Altering a foreing key referenced table
Hi all,
If you want to alter a table that is referenced by a foreign key, you are not allowed to do so. I created a script that dorps the constraints, then waits for you to click an OK button, and finally adds the foreign key constraints again. It copies the SQL generated script to the clipboard as well, and also dumps intermediate results. See instant share for details: share.linqpad.net/donn6t.linq.
Cheers,
Arno Tolmeijer
If you want to alter a table that is referenced by a foreign key, you are not allowed to do so. I created a script that dorps the constraints, then waits for you to click an OK button, and finally adds the foreign key constraints again. It copies the SQL generated script to the clipboard as well, and also dumps intermediate results. See instant share for details: share.linqpad.net/donn6t.linq.
Cheers,
Arno Tolmeijer
Comments
You could also have DropForeignKeyBuilder return an IDisposable, to make the following use possible: so that the keys are restored if the DDL faults:
http://share.linqpad.net/b7qwds.linq