April 26, 2021 at 1:28 pm
Hi
Does anyone know of a good way to Drop and Recreate all Primary and Foreign Key Constraints for all tables in a database please?
Ive looked at various solutions but they dont seem to capture and recreate all the PK and FK constraints for all tables
April 26, 2021 at 1:34 pm
April 26, 2021 at 3:09 pm
Out of interest why do you want to do this? What are you trying to by dropping all your constraints and then simply recreating them?
Constraints need to be dropped in a specific order too when dealing with keys. You can't drop a primary key until all of the foreign keys referencing it are dropped too, so you need to ensure any script you do create does things in the right order as well.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
April 27, 2021 at 3:20 am
This was removed by the editor as SPAM
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply