无法创建关系'FK_amount1_homeshop1'。 " FK_amount1_homeshop1&QUOT ;.冲突发生在数据库表“dbo.homeshop1”,列'cust_Id'中。 [英] Unable to create relationship 'FK_amount1_homeshop1'. "FK_amount1_homeshop1". The conflict occurred in database table "dbo.homeshop1", column 'cust_Id'.

查看:428
本文介绍了无法创建关系'FK_amount1_homeshop1'。 " FK_amount1_homeshop1&QUOT ;.冲突发生在数据库表“dbo.homeshop1”,列'cust_Id'中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法创建关系'FK_amount1_homeshop1'。 ALTER TABLE语句与FOREIGN KEY约束FK_amount1_homeshop1冲突。冲突发生在数据库C:\ NETPROJECTS \ WBPROJECTS \HOMEPROJECT \HOMEPROJECT \APP_DATA \ DATABASE1.MDF,表dbo.homeshop1,列'cust_Id'。plaese保存此问题

Unable to create relationship 'FK_amount1_homeshop1'. The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_amount1_homeshop1". The conflict occurred in database "C:\NETPROJECTS\WPFPROJECTS\HOMEPROJECT\HOMEPROJECT\APP_DATA\DATABASE1.MDF", table "dbo.homeshop1", column 'cust_Id'.plaese save from this problem

推荐答案

用于强制两个表之间关系的外键...实际上它意味着表A中的字段只能从表B中的指定字段获取值...当您创建FK时,SQL会运行完整性检查以查看已创建的记录是否存在关系,否则创建将失败...

您有两种选择:

1.在没有完整性检查的情况下创建FK(WITH NOCHECK)

2.修复表格中的数据......
Foreign key used to force a relation between two tables...practically it means that a field in TABLE A can get values only from the specified field from TABLE B...When you are creating a FK, SQL runs an integrity check to see if relation exists for the already created records, if not the creation will fail...
You have two options:
1. Create FK without integrity check (WITH NOCHECK)
2. Fix data in your table...


这篇关于无法创建关系'FK_amount1_homeshop1'。 " FK_amount1_homeshop1&QUOT ;.冲突发生在数据库表“dbo.homeshop1”,列'cust_Id'中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆