DROP INDEX ERROR

  • I need to DROP all the indexes on my tables and rebuild them. I have 5 TABLES left with INDEXes that I am NOT able to DROP INDEXES. I get the following error:

    Server: Msg 3723, Level 16, State 6, Line 1

    An explicit DROP INDEX is not allowed on index 'Table_Name.Index_Name'. It is being used for FOREIGN KEY constraint enforcement.

    When I do a sp_helpindex on the table, it tells me that the INDEX is "clustered, unique located on PRIMARY"

    Thanks in advance for the quick response!

  • Drop the foreign key first, then drop the index. I suspect you won't be able to recreate the foreign key unless the index is recreated.

    Why do you need to drop them? If you're rebuilding the indexes, what's wrong with DBCC DBREINDEX?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for the quick response!

    This is a new database with all new design. And the people "designing" it keep changing their minds. So there is no data yet.

    I will search for foreign keys and give that a shot.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply