I'm try to delete following constraint but not to drop it:
CREATE UNIQUE NONCLUSTERED INDEX UQ_MyTable_TypeKey ON [dbo].[MyTable]([TypeKey] ASC) WHERE [TypeKey] <> 55555 AND [TypeKey] <> 75555)
Here is drop command:
ALTER TABLE [dbo].[MyTable] DROP CONSTRAINT UQ_MyTable_TypeKey
But getting error:
'UQ_MyTable_TypeKey' is not a constraint.Could not drop constraint.
Also, tried as:
ALTER TABLE [dbo].[MyTable] DROP INDEX UQ_MyTable_TypeKey
But getting following error:
The operation 'ALTER TABLE DROP INDEX' is supported only with memory optimized tables.Could not create constraint or index. See previous errors.
Try following command to drop key constraints:
DROP INDEX UQ_MyTable_TypeKey ON [dbo].[MyTable]
Thanks. Works for me.