Oninit Logo
The Down System Specialists
+1-913-674-0360
+44-2081-337529
Partnerships Contact
Finderr

-892 Cannot disable object object-name due to other active objects using it.

Other objects are using this object. If the object being disabled is an index, then a unique constraint, primary constraint, or referential constraint might be using that object. If the object is a unique or a primary-key constraint, then a referential constraint might be using that object. If an index of a referential constraint is being disabled, then a unique constraint, primary constraint, or some other referential constraint might be using this object.

The following example illustrates one of these scenarios:

CREATE TABLE parent(c1 int, c2 int, c3 int); ALTER TABLE parent ADD CONSTRAINT PRIMARY KEY(c1) CONSTRAINT cons_parent_c1; CREATE TABLE child(x1 int, x2 int, x3 varchar(32)); ALTER TABLE child ADD CONSTRAINT PRIMARY KEY(x1) CONSTRAINT cons_child_x1;

The following ALTER statement is trying to disable the foreign key index that is being shared by the primary key, hence this error 892 is returned:

ALTER TABLE CHILD ADD CONSTRAINT (FOREIGN KEY(x1) REFERENCES PARENT(c1) CONSTRAINT cons_child_x2 INDEX DISABLED);