主键设为identity时往表里insert数据

来源:互联网 发布:手机找不到网络连接 编辑:程序博客网 时间:2024/06/06 10:58

当IDENTITY_INSERT设置为OFF时,不能为表中的标识列插入显式值解决

set identity_insert tableName ON--打开

INSERT INTO tableName (id,column)values(IdValue,cloumnValue)

set identity_insert tableNameOFF--关闭


0 0
原创粉丝点击