获取sql server表的primary key select cu.column_namefrom information_schema.table_constraints t left join information_schema.constraint_column_usage cu on t.constraint_name = cu.constraint_name and cu.table_name = t.table_name left join information_schema.columns c on c.column_name = cu.column_name and c.table_name = cu.table_namewhere constraint_type = 'primary key ' and cu.table_name = ''order by c.ordinal_position
