SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DROP INDEX ERROR


DROP INDEX ERROR

Author
Message
rew-370421
rew-370421
Right there with Babe
Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)

Group: General Forum Members
Points: 744 Visits: 1382
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!
GilaMonster
GilaMonster
SSC Guru
SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)SSC Guru (231K reputation)

Group: General Forum Members
Points: 231353 Visits: 46350
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


rew-370421
rew-370421
Right there with Babe
Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)Right there with Babe (744 reputation)

Group: General Forum Members
Points: 744 Visits: 1382
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search