34,873
社区成员
发帖
与我相关
我的任务
分享insert into tb2 values(008,getdate())消息 547,级别 16,状态 0,第 1 行
INSERT 语句与 FOREIGN KEY 约束"FK_tb1_id"冲突。该冲突发生于数据库"sjk",表"dbo.tb1", column 'id'。
语句已终止。create table tb1
(
id int primary key,
name varchar(20),
)
create table tb2
(
id int primary key,
time datetime
constraint FK_tb1_id FOREIGN KEY(id) REFERENCES tb1(id)
)
go
insert into tb1 values(001,'aa')
insert into tb1 values(002,'bb')