Modified base table foreign key constraints

Modify basic tabular

ALTER  Table  < table name > 
[ the Add [column ]  < new column name > < data type >  [ integrity constraint ] ]
 [ the Add <table-level integrity constraints> ] 
[ drop [column ]  < column name >  [ Cascade | the restrict ] ]
 [ drop constraint <integrity constraint name> [the restrict | Cascade ] ]
 [ ALTER column <column name> <data type> ] ;

Precautions foreign key constraint modification

When increasing the foreign key constraint, the system will automatically assign the name of the foreign key constraints, foreign key constraints need to find out the name of the foreign key constraint and then perform the operation.

Find foreign key constraint

Exec sp_helpconstraint to ' SC ' ;
 // SC has a foreign key table

 

Guess you like

Origin www.cnblogs.com/Neavotre/p/11456967.html