Hi.
I'm getting errors like this when I try to run an upgrade script I'm trying to
write/test:
altering labels to length 60
Server: Msg 5074, Level 16, State 4, Line 5
The object 'ALTPART_ANNOT_ ANNOTID_FK' is dependent on column 'label'.
I used this to bracket my script:
sp_msforeachtab le "ALTER TABLE ? NOCHECK CONSTRAINT all"
go
sp_msforeachtab le "ALTER TABLE ? DISABLE TRIGGER all"
go
/* updates here */
sp_msforeachtab le @command1="prin t '?'",
@command2="ALTE R TABLE ? CHECK CONSTRAINT all"
go
sp_msforeachtab le @command1="prin t '?'",
@command2="ALTE R TABLE ? ENABLE TRIGGER all"
go
I guess the alter table nocheck constraint isn't disabling the fk's
completely?
Is there a way around this, or do I manually have to do the constraint
dropping/recreating?
Thanks
Jeff Kish
I'm getting errors like this when I try to run an upgrade script I'm trying to
write/test:
altering labels to length 60
Server: Msg 5074, Level 16, State 4, Line 5
The object 'ALTPART_ANNOT_ ANNOTID_FK' is dependent on column 'label'.
I used this to bracket my script:
sp_msforeachtab le "ALTER TABLE ? NOCHECK CONSTRAINT all"
go
sp_msforeachtab le "ALTER TABLE ? DISABLE TRIGGER all"
go
/* updates here */
sp_msforeachtab le @command1="prin t '?'",
@command2="ALTE R TABLE ? CHECK CONSTRAINT all"
go
sp_msforeachtab le @command1="prin t '?'",
@command2="ALTE R TABLE ? ENABLE TRIGGER all"
go
I guess the alter table nocheck constraint isn't disabling the fk's
completely?
Is there a way around this, or do I manually have to do the constraint
dropping/recreating?
Thanks
Jeff Kish
Comment