Alter table modify one or more objects in the TABLE to access this column

Source: Internet
Author: User

When the table is modified,

Message 5074, level 16, state 1, 2nd rows

The object 'df _ ddczjlb_m1_ddczj1_5bba8402 'depends on the column 'ddczjlb _ GROUPID '.

Message 4922, level 16, status 9, 2nd rows

Alter table alter column DDCZJLB_GROUPID fails to be accessed by one or more objects.

Solution:

Constraint removal method:

1. Right-click the table name and select design table"

2. After Entering the table design form, right-click and select Properties to remove the constraints.

Method 2

1. Find the name of the constraint for this field in the table (or based on the existing prompt and the object 'df __******')

Declare @ name varchar (50)

Select @ name = B. name from sysobjects B join syscolumns a on B. id = a. cdefault

Where a. id = object_id ('tablename ')

And a. name = 'columname'

2. Delete existing constraints

Exec ('alter table TableName drop constraint' + @ name)

3. Run the script to modify the field type.

Or, disable all programs that use this table.

If not, you can use

Alter table ddczjlb drop constraint df1_ddczjlb_m1_ddczj1_5bba8402 (object). After deletion, execute the command.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.