如果SQL SERVER表中存在两条一模一样的记录,修改其中任何一条时就会报错

xxxfffcn 2004-10-26 10:40:47
在SQL Server Enterprise Manager中错误提示为:
Key column information is insufficient or incorrect.Toomany rows were affected by update.

在delph中用edit,post提交时提示:
Project eims_system.exe raised exception class EOLeException with message 'Key column informmation is insufficient or incorrect.Too many rows were affected by update.'Process stopped.Use Step or Run to continue.

我在表定义时没设置Primary Key哦

怎么会有这样
...全文
361 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
huiwww 2004-10-27
  • 打赏
  • 举报
回复
每个表必须建立id,并设置为不重复主键作为标识,这样就不会出现错误
对于你的问题,如果你进行删除也会出错。sql提示类似的错误“更新过多的行,无法。。。。。”
xxxfffcn 2004-10-27
  • 打赏
  • 举报
回复
多谢大家
山娃马小三儿 2004-10-27
  • 打赏
  • 举报
回复
没办法,只有重新来了,记得设置一个标识字段
Nirvanaxumm 2004-10-27
  • 打赏
  • 举报
回复
对,导入的数据也有可能会出现这种情况。
重建一个表用Sql导吧,没有更好的办法,拖下去浪费时间。
记得设主键阿。
No_1gogo 2004-10-27
  • 打赏
  • 举报
回复
实际上你修改的时候,sql server也是用sql语句来实现数据修改的,当你修改其中一条数据的时候,sql server根本定位不到你要改的那条数据上(因为有两条数据),所以会报错
xxxfffcn 2004-10-26
  • 打赏
  • 举报
回复
在SQL Server Enterprise Manager中我对其中一条进行修改时,错误提示为:
Key column information is insufficient or incorrect.Toomany rows were affected by update.

在delph中用edit,post进行修改后提交时提示:
Project eims_system.exe raised exception class EOLeException with message 'Key column informmation is insufficient or incorrect.Too many rows were affected by update.'Process stopped.Use Step or Run to continue.

我在表定义时没设置Primary Key哦

怎么会有这样
xxxfffcn 2004-10-26
  • 打赏
  • 举报
回复
什么原因造成的,怎么解决?
readersm68 2004-10-26
  • 打赏
  • 举报
回复
无法定位啊

2,498

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧