none
Need to drop constraint from large table

    Question

  • HI All,

    I have a product table which has 10 million data.

    when i try to drop a fk constraint on this table, its taking long time but no success commet.

    Please provide a solution

    Regards,

    JP

    Tuesday, August 05, 2014 11:31 AM

Answers

All replies

  • You can try creating a temp table and load the data into the table and then recreate the table by dropping the constraint and reload the data from temp table

    Anand

    Tuesday, August 05, 2014 3:18 PM
  • Try this:

    ALTER TABLE YourTableName NOCHECK CONSTRAINT YourFKConstraintName

    Then try to drop the FK constraint. It should be faster.


    If this post answers your query, please click "Mark As Answer" or "Vote as Helpful".

    Tuesday, August 05, 2014 3:31 PM