views:

164

answers:

2

I have a constraint (named INVS_ITEM_LOCATIONS_PK) in my SQL Server 2005 table.

How can I disable it?

+3  A: 

I am not sure if you can DISABLE a constraint, maybe you need to DROP the constraint?

Mark Redman
I GOT ANSWER GUYS
Domnic
A: 

ALTER TABLE INVS_ITEM_LOCATIONS NOCHECK CONSTRAINT INVS_ITEM_LOCATIONS_PK

Domnic
I tried it but it seems it is not allowed for primary keys. Based on the naming convention I assume this constraint is indeed for a PK. TW, I get the following error: "Object 'my_pk' cannot be disabled or enabled. This action applies only to foreign key and check constraints."
Philip Fourie