我有两个表是这样的:不能创建在SQL Server表的外键
tblGender
和TblPerson
我要定国外键为GenderID
..但我收到此错误:
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "tblPerson_GenderID_FK". The conflict occurred in database "Sample", table "dbo.tblGender", column 'id'.
共享这两个表格的创建表脚本 –
我创建了两个表手动 – user2878851
右键单击表 - >脚本表as->创建到。将给出表格的创建脚本。查看下面给出的答案。 –