日期:2014-05-18  浏览次数:20474 次

一个表的列怎么设置成另外两个表的外键
UserId 回复者Id Varchar(20) 非空 TeacherUsesr表或StudentUsers表的外键

------解决方案--------------------
SQL code
alter table user
add constraint fk_test foreign key(UserId)
references TeacherUsesr(UserId)
go

alter table user
add constraint fk_test foreign key(UserId)
references StudentUsers(UserId)
go