SqlServer how to auto-increment assignment (SET IDENTITY_INSERT ON)

If you want to auto-increment assignment, you need the following settings

 

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

Guess you like

Origin www.cnblogs.com/fanfan-90/p/12520174.html