设置主、外键

sql语句建表时设置主、外键

create table Project_Voice

(

ID int not null,

voiceID int not null,

projectID int not null,

primary key(ID),

foreign key(voiceID) references dbo.Voice(ID),

foreign key(projectID) references dbo.Project(ID)

)

原文地址:https://www.cnblogs.com/Zbuxu/p/5924045.html