添加外键约束
添加外键约束(关联字段要用括号括起来) -- ALTER TABLE 从表 -- ADD CONSTRAINT 约束名 FOREIGN KEY (关联字段) references 主表(关联字段); --例如: ALTER TABLE BusinessBills ADD CONSTRAINT FK_BusinessBillPackageBusinessBills FOREIGN KEY (BusinessBillPackageId) references BusinessBillPackage(Id);