如果想给自增列赋值,需先将自增关闭,插入完数据后再打开 

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

 

相关文章: