其他分享
首页 > 其他分享> > 如何给自增列赋值(SET IDENTITY_INSERT ON)

如何给自增列赋值(SET IDENTITY_INSERT ON)

作者:互联网

如果想给自增列赋值,需要如下设置

 

set Identity_insert [tb1] on
GO
INSERT INTO [dbo].[tb1]
([ID],[Name]
,[ClassName])
VALUES
(4,'zhangsan'
,'一班')
GO
set Identity_insert [tb1] off

标签:INSERT,SET,insert,tb1,增列,set,Identity,赋值
来源: https://www.cnblogs.com/fanfan-90/p/12520174.html