脚本如下:
USE [Person_DB]
GO
INSERT INTO [dbo].[cResourceText]
([ResourceFK],[LanguageFK],[Text])
VALUES
(N'ApplicationName_BiometryEnrollment',N'CHS',N'指纹信息采集工具')
GO
报错信息如下:
Msg 547, Level 16, State 0, Line 4
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_cResourceText_cResource". The conflict occurred in database "WES_KABAAS_DB", table "dbo.cResource", column 'ResourceID'.
The statement has been terminated.
是否可以插入内容时忽略约束检查?多谢指点!
不可以的,约束是在数据库定义语言中设置的,完整性规则一定要满足,不然插入的数据也是垃圾数据
温馨提示:答案为网友推荐,仅供参考