Righteous Wrath Online Community

General => Tech Chat => Topic started by: Mr. Analog on May 23, 2014, 04:45:07 PM

Title: Drop and Recreate ALL Foreign Keys in a MS SQL Server Database
Post by: Mr. Analog on May 23, 2014, 04:45:07 PM
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
Title: Re: Drop and Recreate ALL Foreign Keys in a MS SQL Server Database
Post by: Thorin on May 23, 2014, 07:40:38 PM
We don't need no steenkeen' badges^H^H^H^H^H^Hforeign keys!
Title: Re: Drop and Recreate ALL Foreign Keys in a MS SQL Server Database
Post by: Mr. Analog on May 23, 2014, 07:41:14 PM
LOL