Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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;
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql count multiple columns in one query 
Sql :: sql server phone constraint 
Sql :: ERROR: syntax error at or near "AUTO_INCREMENT" posgtresql 
Sql :: SQL Less Than or Equal to Operator 
Sql :: query distinct 
Sql :: median mysql 
Sql :: installing mysql on centos 7 
Sql :: create tablespace oracle multiple datafiles 
Sql :: oracle convert run duration to number 
Sql :: get count of null in column sql 
Sql :: sql server remove primary key without dropping table 
Sql :: c# update sql statement 
Sql :: how to find special characters in sql 
Sql :: sql download for windows 10 
Sql :: sql alter table order by 
Sql :: is numeric in sql 
Sql :: SQL CASE With ELSE in SQL 
Sql :: postgre insert select 
Sql :: declare table variable sql 
Sql :: sql server select another database 
Sql :: Get all index postgres 
Sql :: sql right join 
Sql :: insert into without column names 
Sql :: SQL LIMIT With OFFSET Clause 
Sql :: mysql find_in_set join 
Sql :: truncate psql 
Sql :: oracle create package body 
Sql :: smallint sql 
Sql :: mysql command 
Sql :: identity syntax in sql 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =