如题.
有没有键? select OBJECTPROPERTY(OBJECT_ID(tbName) , 'TableHasPrimaryKey') 键是什么? select COLUMN_NAME from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where TABLE_NAME = tbName