Monday, March 19, 2012

ALTER TABLE ALTER COLUMN [access-id] failed because one or more objects access this column

Hi

when I'm upgrading table schema with alter statement

I'm getting error like this

ALTER TABLE ALTER COLUMN [access-id] failed because one or more objects access this column

can Anybody tell the solutiuon plz.

Thank u .

vizai

Please check to see if you have foreign key(s) referencing the column.|||

hi Waldrop

The column has a constraint

|||

If you have any View /UDF With SchemaBinding on this Base table , you are not allowed to change or Drop columns or Table Object..

If you want to alter the table first you need to remove the SchemaBinding in all the views/UDF and change the column on Base table then recreate the Views/UDFs With SchemaBinding.

If you have any Indexed Views when you remove the SchemaBinding all the Index on the Views will be removed, so you have to create them too..

|||

Hi mani

Thanks fo the reply.

How can I use schemabinding to drop the views / udf / indexed views using SMO.

How can I generate the drop script alone for all the views / udf / indexed views / constraints.

Can u help me in this

No comments:

Post a Comment