我有一个现有的表,我要吹走,因为我没有创建它与 ID
列设置为表的标识列。
使用 SQLServerManagementStudio,我编写了现有表的 "Create To..."脚本,并得到以下结果:
CREATE TABLE [dbo].[History](
[ID] [int] NOT NULL,
[RequestID] [int] NOT NULL,
[EmployeeID] [varchar](50) NOT NULL,
[DateStamp] [datetime] NOT NULL,
CONSTRAINT [PK_History] PRIMARY KEY CLUSTERED
(
[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]
我的问题是,我应该如何修改这个 SQL
,使得我的结果表中的 ID
列被设置为 身份?