作为概述。
我创建了一个表,并在主键列的Identity Specification下设置,Identity Increment为1,Identity Seed也设置为1(在表的设计中)。
但我注意到增量(插入值时)为1 ... 2然后是1001 ... 1002 ... 1003。
为什么会这样?
这是表
的CREATE脚本CREATE TABLE [dbo].[Opl_Question](
[Question_Id] [int] IDENTITY(1,1) NOT NULL,
[QuestionName] [nvarchar](500) NULL,
[QuestionDescription] [nvarchar](500) NULL,
[QuestionType] [nvarchar](20) NULL,
[DateCreated] [datetime] NULL,
[DateUpdated] [datetime] NULL,
[ChecboxCountCorrect] [int] NULL,
[OPL_Id] [int] NULL,
CONSTRAINT [PK_Opl_Question] PRIMARY KEY CLUSTERED
(
[Question_Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
插入是暂时手动添加一些数据
USE DB
GO
INSERT INTO Opl_Question(QuestionName, QuestionDescription, QuestionType, DateCreated, DateUpdated, ChecboxCountCorrect, OPL_Id)
VALUES('2. Question 2', '2. Question 2', 'radio', GETDATE(), GETDATE(), 0, 2)