SQL Server通过系统信息表获取表中字段信息的方法
获取表中各字段信息:
select * from syscolumns where id=object_id('表名')
获取表中主键的方法:
select * from sysobjects where xtype ='pk'
外键同理
举例:查询表'cdt_1x_basic'的字段信息(包括主键信息)
select a.*,
case b.IsPK when 1 the...
原创
2010-05-06 13:52:36 ·
165 阅读 ·
0 评论