sqlserver中set IDENTITY | 您所在的位置:网站首页 › identify_insert设置为off › sqlserver中set IDENTITY |
sqlserver中set IDENTITY_INSERT on 和 off 的设置方法 sqlserver中set IDENTITY_INSERT on 和 off 的设置方法: 执行插入数据库插入数据时报了以下错误,我明明没有给主键set值但还是报错 解决方法如下: qlserver 批量插入记录时,对有标识列的字段要设置 set IDENTITY_INSERT 表名 on,然后再执行插入记录操作;插入完毕后恢复为 off 设置 格式: set IDENTITY_INSERT 表名 on set IDENTITY_INSERT 表名 off 举例: set IDENTITY_INSERT peoplePworkpositiontype on insert peoplePworkpositiontype(id,workpositiontype,workpositiontypeid) values(1 , '平台' , 1 ) insert peoplePworkpositiontype(id,workpositiontype,workpositiontypeid) values(2 , '陆地' , 2 ) insert peoplePworkpositiontype(id,workpositiontype,workpositiontypeid) values(3 , '海上' , 3 )
详细介绍请查看全文:https://cnblogs.com/qianzf/ 原文博客的 |
CopyRight 2018-2019 实验室设备网 版权所有 |