僅當使用了列列表而且 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

相關文章
相關標籤/搜索