UPDATE语句与FOREIGN KEY冲突 [英] UPDATE statement conflicted with the FOREIGN KEY

查看:459
本文介绍了UPDATE语句与FOREIGN KEY冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我想更新主表以及其他表中的值
例如:在"Employee"中为empcd,在"salary"中为empcd,在所有包含主键和外键值的表中都是这样,最简单的方法是什么?
谢谢..

hello,
i want to update values in master tables as well as in other table also
eg: empcd in''Employee'' and empcd in ''salary'' , like this in all tables which contains primary and foreign key values, What is the simplest way to do so?
thanking you..

推荐答案

最简单的方法是插入有效的值,这样就不会出现异常.我认为这意味着一旦存在外键(employee ID),首先要插入一个雇员,然后再插入他们的薪水.
The simplest way is to insert values that are valid, so you don''t get an exception. I assume that means inserting an employee first, then inserting their salary, once the foreign key ( employee ID ) exists.


这篇关于UPDATE语句与FOREIGN KEY冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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