Back to list Standard SQL How to remove a unique constraint in SQL? Database: SQL PostgreSQL Oracle SQL Server Operators:DROP CONSTRAINT, ALTER TABLE Problem: You would like to remove a unique constraint from the column/columns in a table in a database. Example: We would like to drop the unique constraint in the table product from the column name. The statement below shows how to do it. Solution ALTER TABLE product DROP CONSTRAINT UQ_product_name In this example the table product is altered by using the ALTER TABLE clause. After this clause you enter the name of the table (in our example: product) and the clause DROP CONSTRAINT with the name of the unique constraint you want to remove. You can find the name of the constraint in the meta data of your database. Each database engine has a different method of naming constraints. In SQL Server, you can check the name of the constraint by selecting data from the sys.key_constraints table in a given database. In PostgreSQL, select the conname column from the pg_constraint table. The Oracle server contains this data in the user_constraints table, and MySQL allows getting names from the CONSTRAINT_NAME column in information_schema.TABLE_CONSTRAINTS. Recommended courses: The Basics of Creating Tables Data Types in SQL SQL Constraints Recommended articles: How to Create a Table in SQL Understanding Numerical Data Types in SQL See also: How to Create One Table From Another Table in SQL How to Remove a Primary Key in SQL How to Create a Primary Key in SQL How to remove a unique constraint in SQL? Tags: SQL PostgreSQL Oracle SQL Server Subscribe to our newsletter Join our weekly newsletter to be notified about the latest posts.