查询所有的用户表
select * from sysobjects where xtype='U'
查询某个用户表
select * from sysobjects where xtype='U' and id=object_id('用户表名称')
查询表字段
select * from syscolumns where id=object_id('用户表名称')
查询表外键
select * from syscolumns
where id=object_id('用户表名称')
and
colid in(select fkey from sysforeignkeys where fkeyid=object_id('用户表名称'))
阅读(1227) | 评论(0) | 转发(0) |