情景: 如果此表的主键或者其中有一个列使用了  IDENTITY(1,1) 自增长时,但又想手动为此列指定值时,当用如下解决方案:

set identity_insert 表名 ON

使用此命令把表的自增列设置为ON

然后使用 :

SELECT 3,0,'阿道夫',141,0,2,'133','09 24 2008  3:23PM','133','09 24 2008  3:23PM',0,'NULL'

的方式,插入数据(是使用Select的方式,不能用Insert into).


插入完成以后,再把列设置为OFF


set identity_insert [agent_ctm_shopgroup_tbl] OFF


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
猜你喜欢
  • 2022-12-23
  • 2021-10-22
  • 2022-03-02
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案