Answers for "how to add unique constraint in sql"

SQL
3

sql server add unique constraint

-- Add a Unique constraint and deifine the constraint name
ALTER TABLE TableName
ADD	CONSTRAINT TableName_ColumnName_Unique UNIQUE (ColumnName)
Posted by: Guest on January-22-2021
1

how to drop a unique constraint in sql

SHOW CREATE TABLE [tableName]
-- Find the constraintID after CONSTRAINT 'constraintID'
ALTER TABLE [tableName] DROP FOREIGN KEY constraintID
Posted by: Guest on October-29-2020
1

unique constraint mssql

USE AdventureWorks2012;  
GO  
CREATE TABLE Production.TransactionHistoryArchive4  
 (  
   TransactionID int NOT NULL,   
   CONSTRAINT AK_TransactionID UNIQUE(TransactionID)   
);   
GO
Posted by: Guest on August-03-2020

Code answers related to "how to add unique constraint in sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language