先执行alter table 表名alter column 列名 int not null再执行alter table 表名 add constraint PK_主键约束 primary key (lie)执行第一句前提是表中的lie列没有空值才可以