SQL server 建立标后,执行代码添加外键

alter table dbo.student add constraint FK_tstudent_class foreign key(classno) references dbo.class(classno);

alter table 表名 add constraint 外键约束名 foreign key(列名) references 引用外键表(列名);

原文地址:https://www.cnblogs.com/Armstrongwhirls/p/8783537.html