使用sql语句设置主键自增长
新增时:
CREATE TABLE [dbo].[rescue_material_configure] ( [id] int IDENTITY(1,1) NOT NULL, [category_id] int NOT NULL, [material_name] varchar(100) COLLATE Chinese_PRC_CI_AS NULL, [base] varchar(100) COLLATE Chinese_PRC_CI_AS NULL, [operate_date] datetime NOT NULL )
修改表时:
ALTER TABLE [dbo].[nurse_impower_type_content] DROP COLUMN id; ALTER TABLE [dbo].[nurse_impower_type_content] ADD id BIGINT Identity(1,1) NOT NULL;
还没有评论,来说两句吧...