Because the object name was found ' dbo. T3 ' and index name ' pk__t3__3214ec2706cc942b ' have duplicate keys, so the CREATE UNIQUE index statement terminates. The duplicate key value is (1).

Source: Internet
Author: User
Tags terminates

SQL statement: ALTER TABLE T3 ADD PRIMARY KEY (ID);

Execution Error:

MSG 1505, Level 16, State 1, line 1th
Because the object name was found ' dbo. T3 ' and index name ' pk__t3__3214ec270466e04c ' have duplicate keys, so the CREATE UNIQUE index statement terminates. The duplicate key value is (1).
Msg 1750, Level 16, State 0, line 1th
Unable to create constraint. See the preceding error message.
Statement has been terminated.

Cause of Error:

To build a primary key on the ID column, but the ID column data is duplicated and not unique.

Because the object name was found ' dbo. T3 ' and index name ' pk__t3__3214ec2706cc942b ' have duplicate keys, so the CREATE UNIQUE index statement terminates. The duplicate key value is (1).

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.