我的SQL更新问题在主键 [英] my sql update problem in primary key

查看:70
本文介绍了我的SQL更新问题在主键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

im尝试通过设置value1 = @ value1更新和现有记录,其中value1 = value1
但它不起作用

im trying to update and existing record by set value1=@value1 where value1 = value1
but its not working

推荐答案

如果要更新主键,则需要确保不插入任何重复值.

另一个问题可能是关系,如果您要从任何表引用该表,则需要先更新该表,然后才能更新此表.

检查两个senario.

对于第二个senario,您可以删除所有子行或更新子行.

如果这不能解决您的问题,请复制错误,同时更新.
If you are updating primary key then you need to make sure that no duplicate value should be inserted.

The other problem can be with the relationship if you are refering from any table to this table then you need to update that table first then you can update this table.

Check both the senario.

For the second senario, Either you can delete all the child rows or update child row.

If this not resolve you problem, Please copy the error what you getting while update.


您无法更新身份列值.


这是不正确的问题你能解释吗?
that is not proper question can u explain it ?


这篇关于我的SQL更新问题在主键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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