--Enable or disable all foreign KEY constraints for the specified table
ALTER TABLE Tbname NOCHECK constraint all
ALTER TABLE Tbname CHECK constraint all
--View constraints
Select Name, is_disabled from Sys.foreign_keys order by name
--Disable
ALTER TABLE tbname DISABLE TRIGGER trigname
--Recovery
ALTER TABLE tbname ENABLE TRIGGER trigname
--Disable all triggers on a table
ALTER TABLE tbname DISABLE TRIGGER All
--Enable all triggers on a table
ALTER TABLE tbname ENABLE TRIGGER All
--Add primary key
ALTER TABLE TBNAME ADD constraint Pk_name primary key (COLUMN1,COLUMN2)
--Adding nonclustered primary keys
ALTER TABLE TBNAME ADD constraint Pk_name primary key nonclustered (COLUMN1,COLUMN2)
--Delete primary key
ALTER TABLE tbname DROP constraint Pk_name
--Add FOREIGN key ALTER TABLE TBNAME ADD constraint fk_name foreign key (fk_column) references Pk_tbname (pk_column)--delete foreign key ALTER TABLE t Bname drop Constraint Fk_name
--Add UNIQUE constraint ALTER TABLE TBNAME add constraint uq_colname unique (colname)
SQL Server disables enabling triggers, FOREIGN KEY constraints