Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

DROP INDEX ERROR Expand / Collapse
Author
Message
Posted Wednesday, November 18, 2009 7:41 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 9:24 AM
Points: 205, Visits: 1,352
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!
Post #820841
Posted Wednesday, November 18, 2009 7:59 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 9:36 AM
Points: 42,765, Visits: 35,863
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 2008, MVP
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

Post #820853
Posted Wednesday, November 18, 2009 8:13 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Today @ 9:24 AM
Points: 205, Visits: 1,352
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.
Post #820869
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse