Drop Index problem MSS 2008

  • Hello all,

    I have a DB with a table that has a unique index on a single column. That column is also the primary key of the table.

    A patch was put into the code stream to drop that unique index as there should already be one due to the PKEY constraint. This patch works fine in MSS 2005.

    Take the same DB, and start it on a 2008 server, and the patch fails:

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

    Is there a way around this? Perhaps to find which of many fkey's to the pkey of that table are using the index and drop/recreate?

  • Drop all the foreign keys that reference that table. Drop the unique index. Recreate the foreign keys.

    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

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

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