Add fields and delete fields in the table (add auto-increment columns)

 

1. Add fields to the table

ALTER TABLE t1 ADD test VARCHAR(20) NULL

-- NULL means the field can be null

2. Delete fields from the table

alter table t1 drop column test

 

3. Add auto-increment column

In this way, you will definitely get the latest one when inserting in batches

ALTER TABLE t1 ADD num [int]    IDENTITY   (1,   1)   NOT   NULL 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325127077&siteId=291194637