创建表时候
添加时候
去除时候
1 2 3 4 | CREATE TABLE tb ( id INT IDENTITY(1,1) PRIMARY KEY , ) |
添加时候
1 2 | ALTER TABLE tb ADD CONSTRAINT PK_id PRIMARY KEY (id) |
去除时候
1 2 | alter table tb drop constraint PK_id |
ALTER TABLE Employees
ADD CONSTRAINT PK_EmployeesID PRIMARY KEY (EmployeeID)
设置主键关键词是 PRIMARY KEY
CONSTRAINT PK_EmployeesID 设置主键名称
ADD CONSTRAINT PK_EmployeesID PRIMARY KEY (EmployeeID)
设置主键关键词是 PRIMARY KEY
CONSTRAINT PK_EmployeesID 设置主键名称