不允许对索引显式地使用 DROP INDEX,该索引正用于 UNIQUE KEY

[转载]http://blog.csdn.net/w87875251l/article/details/7929657

不允许对索引显式地使用 DROP INDEX,该索引正用于 UNIQUE KEY 约束的强制执行的解决方法


今天在Microsoft Sql Server Management Studio中删除索引时报出了以下错误:
不允许对索引 'dbo.Sale_BOM.IX_Sale_BOM_GMIDandDate' 显式地使用 DROP INDEX。该索引正用于 UNIQUE KEY 约束的强制执行。

------------------------------
删除 对于 索引“IX_Sale_BOM_GMIDandDate”失败。  (Microsoft.SqlServer.Smo)

有关帮助信息,请单击: http://go.microsoft.com/fwlink?
ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.Fail
edOperationExceptionText&EvtID=删除+Index&LinkId=20476

------------------------------
其他信息:

执行 Transact-SQL 语句或批处理时发生了异常。 (Microsoft.SqlServer.ConnectionInfo)

------------------------------

出现这种提示时,可改为sql语句删除即可,示例如下:


alter table Sale_OrderList drop constraint IX_Sale_BOM_GMIDandDate

原文地址:https://www.cnblogs.com/xmily/p/3646825.html