Drop and Recreate ALL Foreign Keys in a MS SQL Server Database

Started by Mr. Analog, May 23, 2014, 04:45:07 PM

Previous topic - Next topic

Mr. Analog

I was tired of playing whack-a-mole while creating a deployment script of what FKs were still bound to a table so I went looking for a solution and found one!

John Paul Cook offers a solution with this script that will generate the DROP / CREATE for all your FK constraints:
http://sqlblog.com/blogs/john_paul_cook/archive/2009/09/17/script-to-create-all-foreign-keys.aspx
By Grabthar's Hammer

Thorin

We don't need no steenkeen' badges^H^H^H^H^H^Hforeign keys!
Prayin' for a 20!

gcc thorin.c -pedantic -o Thorin
compile successful

Mr. Analog

By Grabthar's Hammer