Answers for "sql server create constraint"

SQL
0

sql server create constraint

ALTER TABLE my_table ALTER COLUMN [Name] VARCHAR(50) NOT NULL;
ALTER TABLE my_table ADD CONSTRAINT UQ__Constrai UNIQUE (ID);
ALTER TABLE my_table ADD PRIMARY KEY (ID);
-- Get constraints names
SELECT CONSTRAINT_NAME,
     TABLE_SCHEMA ,
     TABLE_NAME,
     CONSTRAINT_TYPE
     FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
   WHERE TABLE_NAME='my_table';
ALTER TABLE my_table DROP CONSTRAINT PK__Constrai__xxxxx;
Posted by: Guest on April-17-2021

Code answers related to "sql server create constraint"

Code answers related to "SQL"

Browse Popular Code Answers by Language