Welcome to my website, have a nice day!
Dream it, Do it, Make it!

SQL SERVER插入数据(主键列自增)

插入数据SQL示例:

SET IDENTITY_INSERT [dbo].[tb_peidang_rijihua] ON 

INSERT INTO [dbo].[tb_peidang_rijihua]([id], [chuangjianrenbianhao], [chuangjianshijian], [rijihuabianhao], [riqi], [xingqi], [xiugairenbianhao], [xiugaishijian], [zhibanbanzhangbianhao], [zhibanganbubianhao], [zhoujihuabianhao], [zhuangtai], [chufangzhiriyuanbianhao], [zhibantongxinyuanbianhao], [beiqingbianzubianhao], [zhiqingbianzubianhao]) VALUES ((SELECT ISNULL(MAX(id)+1,0) FROM dbo.tb_peidang_rijihua WITH(SERIALIZABLE, UPDLOCK)), '1a03f04a08e446b1a7193d06cf7be311', '2020-11-15 18:25:46.1910000', '27d9fe8a5c7644968251bfedf938eade', '2020-11-16', '星期一', NULL, NULL, '0de87873d93944f8b8c8b8215e966f6b', '1a03f04a08e446b1a7193d06cf7be311', '6bee9f5f6ce24ecd9a9088fb0873d33f', '1', '516c5fd26bdc46588dca51a16b7d1ecb', '0de87873d93944f8b8c8b8215e966f6b', '0f9714cd1db04e03baeba2b8f1aa9f1c', 'f7743dfd04ad43c9a421d8bf2d5582d3');

SET IDENTITY_INSERT [dbo].[tb_peidang_rijihua] OFF

其中id列为自增列。

赞(0)
未经允许禁止转载:Ddmit » SQL SERVER插入数据(主键列自增)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址