摘要: 获取表主键1:SELECT TABLE_NAME,COLUMN_NAME FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGEWHERE TABLE_NAME<>'dtproperties'2:EXEC sp_pkeys @table_name='表名'3:select o.name as 表名,c.name as 字段名,k.colid as 字段序号,k.keyno as 索引顺序,t.name as 类型 from sysindexes i join sysindexkeys k on i.id = k.id and 阅读全文
posted @ 2011-06-12 18:10 炒米饭 阅读(7969) 评论(0) 推荐(1) 编辑