仅当使用了列列表而且 IDENTITY_INSERT 为 ON 时,才能为表'Address'中的标识列指

 

  在有自增加的SQL表格里面插入指定ID的数据的时候,会禁止你操做,提示如题目,解决办法:ide

set identity_insert address on

insert Address (ID,AddressID,AddressName,ParentID,LevelOrder,FactoryID) values(200,200,'低压配电房',0,NULL,105) set identity_insert address off

 

  注意,列名是不能省略的,并且执行完成以后,最好off一下spa

相关文章
相关标签/搜索