码迷,mamicode.com
首页 > 其他好文 > 详细

The object 'DF__*' is dependent on column '*' - Changing int to double

时间:2021-04-30 12:45:29      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:targe   serve   mat   col   ecif   int   lock   otherwise   cannot   

The object ‘DF__*‘ is dependent on column ‘*‘ - Changing int to double

Try this:

Remove the constraint DF_Movies_Rating__48CFD27E before changing your field type.

The constraint is typically created automatically by the DBMS (SQL Server).

To see the constraint associated with the table, expand the table attributes in Object explorer, followed by the category Constraints as shown below:

技术图片

 

 

 You must remove the constraint before changing the field type.

 

Changing the size of a column referenced by a schema-bound view in SQL Server

The object ‘Address_e‘ is dependent on column ‘Addr1‘.
ALTER TABLE ALTER COLUMN Addr1 failed because one or more objects access 
this column.

The views are probably created using the WITH SCHEMABINDING option and this means they are explicitly wired up to prevent such changes. Looks like the schemabinding worked and prevented you from breaking those views, lucky day, heh? Contact your database administrator and ask him to do the change, after it asserts the impact on the database.

From MSDN:

SCHEMABINDING

Binds the view to the schema of the underlying table or tables. When SCHEMABINDING is specified, the base table or tables cannot be modified in a way that would affect the view definition. The view definition itself must first be modified or dropped to remove dependencies on the table that is to be modified.

 

CREATE VIEW (Transact-SQL)

SCHEMABINDING
Binds the view to the schema of the underlying table or tables. When SCHEMABINDING is specified, the base table or tables cannot be modified in a way that would affect the view definition. The view definition itself must first be modified or dropped to remove dependencies on the table that is to be modified. When you use SCHEMABINDING, the select_statement must include the two-part names (schema.object) of tables, views, or user-defined functions that are referenced. All referenced objects must be in the same database.

Views or tables that participate in a view created with the SCHEMABINDING clause cannot be dropped unless that view is dropped or changed so that it no longer has schema binding. Otherwise, the Database Engine raises an error. Also, executing ALTER TABLE statements on tables that participate in views that have schema binding fail when these statements affect the view definition.

 

The object 'DF__*' is dependent on column '*' - Changing int to double

标签:targe   serve   mat   col   ecif   int   lock   otherwise   cannot   

原文地址:https://www.cnblogs.com/chucklu/p/14721377.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!