3-sql Server 2008 Using SQL statements to delete constraints

Source: Internet
Author: User

The basic syntax is:

ALTER Table Table Name

DROP CONSTRAINT constraint name 1, constraint name 2 ...

If you delete a constraint, you do not need the name of the constraint after the comma, and if you delete two and more than two constraints, you must separate them with commas.

Use the employee table in the previous section to delete the Fk_personid foreign KEY constraint and the Pk_employeeid PRIMARY KEY constraint in the employee table, with the following code:

 Use -- using the Personinfo database GO ALTER TABLE Employee -- Delete Fk_personid foreign KEY constraints and Pk_employeeid primary KEY constraints in the employee table DROP CONSTRAINT Fk_personid,pk_employeeid GO

Results:

3-sql Server 2008 Using SQL statements to delete constraints

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.