–设置主键
–alter table 你的表名 add constraint pk_s primary key (id)
select ‘alter table ‘ + table_name + ‘ add constraint pk_’+table_name +’_’+ column_name + ‘ primary key (‘+column_name+’) ;’
from information_schema.columns
where column_name=’id’ order by table_name;