sqlServer主键设置自增

sqlserver id自增

  • 研究了navicat没有直接添加字段时设置自增,只能够在使用sql创建表格时去进行设置id的自增
    [id] [int] identity(1,1) NOT NULL
  • 全部创建语句:
USE [SCM_DB]
GO

/****** Object:  Table [dbo].[base_store_data]    Script Date: 2023/11/29 10:08:59 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[base_store_data](
	[id] [int] identity(1,1) NOT NULL,
	[createDate] [date] NULL,
	[updateDate] [date] NULL,
	[isDelete] [int] NULL,
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]
GO

你可能感兴趣的:(sqlserver,数据库,sql)