Question

I need to modify the data type of a table column which is considered to be done via the statement:

ALTER TABLE QUANTITIES_NEW ALTER COLUMN VERSION_NEW VARCHAR(12);

Unfortunately I go an error (German)

Meldung 5074, Ebene 16, Status 1, Zeile 1
Das Objekt-Objekt 'UQ_QUANTITIES_NAME_VERSION' ist vom Spalte-Objekt 'VERSION_NEW' abhängig.
Meldung 4922, Ebene 16, Status 9, Zeile 1
Fehler bei ALTER TABLE ALTER COLUMN VERSION_NEW, da mindestens ein Objekt auf diese Spalte zugreift.

which can be translated to:

The object-object 'UQ_QUANTITIES_NAME_VERSION' depends on the column object 'VERSION_NEW'.
Failure at ALTER TABLE ALTER COLUMN VERSION_NEW, because this column is accessed by one or more columns.

I assumed that the unique constraint isn't disabled. Therfore I executed the statement

ALTER TABLE QUANTITIES  NOCHECK CONSTRAINT ALL
;

too. But still the same error.

Was it helpful?

Solution

DROP the associated CONSTRAINT. If you explode your tables, in the section constraints you'll find a constraint linked to your field. Drop it. After you can change your field type

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top