异常为"当IDENTITY_INSERT设置为OFF时" 的解决

简介:

当 IDENTITY_INSERT 设置为 OFF 时,不能向表"A" 中的标识列插入显示值。

解决方法:

1.有一项数据(message_id)如是自动添写的。把那列删掉就可以写进去了。 具体为:

原始:"insert into user_message(message_id,user_id,message_content) Values(11,333,'hahaha')";  //报错

改成:"insert into user_message(user_id,message_content) Values(333,'hahaha')";

 2.先运行“SET IDENTITY_INSERT 表名 ON”,再运行你的插入语句,再执行“SET IDENTITY_INSERT STREAM OFF”就可以了。

目录
相关文章
|
JSON fastjson 数据格式
报错:JSONException: illegal identifier : {pos 1, line 1, column 2{{"group":"trade_p0&qu
报错:JSONException: illegal identifier : {pos 1, line 1, column 2{{"group":"trade_p0&qu
458 0
|
开发者
返回 account_number|学习笔记
快速学习返回 account_number。
84 0
返回 account_number|学习笔记
|
Java
Can't convert boolean to string automatically, because the "boolean_format" setting was "true,false"
五月 11, 2017 5:06:50 下午 freemarker.log._JULLoggerFactory$JULLogger error 严重: Error executing FreeMarker template FreeMarker template error: Can't con...
2724 0
|
关系型数据库 MySQL
报错:Incorrect datetime value: '0000-00-00 00:00:00' for column 'login_time' at row 1
报错:Incorrect datetime value: '0000-00-00 00:00:00' for column 'login_time' at row 1
571 0
|
SQL 关系型数据库 MySQL
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】
617 0
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】
|
自然语言处理
合同结构化文书解析失败,请联系管理员排查:{"code":3001,"message":"File transform error","success":false,"tracerId":"requestId"}报错处理
在使用自然语言处理自学习平台时,标注任务需要上传标注数据,但是使用doc格式上传文件后开始标注时出现了此提示,此篇文章简单介绍下此问题的处理方式。
608 0
合同结构化文书解析失败,请联系管理员排查:{"code":3001,"message":"File transform error","success":false,"tracerId":"requestId"}报错处理
|
存储
One order里user status和system status的mapping逻辑
One order里user status和system status的mapping逻辑
One order里user status和system status的mapping逻辑
OPA 13 - ok(oButton,"find the Create button");
Created by Wang, Jerry, last modified on Nov 08, 2015
100 0
OPA 13 - ok(oButton,"find the Create button");