sql server错误提示信息

seima 2003-07-18 11:53:01
sql server错误提示信息:

其他用户已经修改了该表或视图内容;您正在修改的数据库行在数据库中已经存在
数据库错误:‘[microsoft][odbc sql server driver][sql server]’
update 语句与column reference
约束'Fk_current_cInvc_6581EB1c'冲突,该冲突发生在数据库‘ufdata_005_2003’
表‘current stock,’column 'cInvcode'
[microsoft][odbc sql server driver][sql server]语句已经终止
是什么原因呢?
...全文
110 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
pengdali 2003-07-18
  • 打赏
  • 举报
回复
Create database cat
go
use cat
go
CREATE TABLE s(s# int not null primary key,s_name varchar(8) not null)
go
CREATE TABLE c (c# int not null primary key,c_name varchar(8) not null)
go
CREATE TABLE cs(c# int not null,s# int not null,cj tinyint not null default(0),
primary key (c#,s#),foreign key(s#) references s(s#),foreign key(c#) references c(c#))
go


insert s values(1,'saa')
insert c values(1,'caa')

--这句是对的
insert cs values(1,1,86)

--这句是错的,sql会报错,应为s表的s#列里没有2
insert cs vlaues(2,1,45)

你犯的错和上面一样
seima 2003-07-18
  • 打赏
  • 举报
回复
Inventory表以cInvCode作主索引

CurrentStock表 以AutoId作主索引
seima 2003-07-18
  • 打赏
  • 举报
回复
我的数据库中有两个表CurrentStock 和Inventory ,两个表中都有cInvCode 字段,
现在就是想修改里面的内容,出现上面的错误
sony19791015 2003-07-18
  • 打赏
  • 举报
回复
这个好像我也遇到过,这个有可能是主码不一致引起的!你更换一下主码试试!
crystaltam 2003-07-18
  • 打赏
  • 举报
回复
你設一個唯一鍵值作索引試試

34,590

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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