看到http://www.cnblogs.com/bluesky521/archive/2007/03/23/685783.html关于这个主题,其实有更好的方法:
1.采用SqlDemo
2.采用如下Sql语句:
A获得所有的用户表
select name, id from sysobjects where (type = 'U') AND (name != 'dtproperties') AND (name != 'SysConfigure') AND (name != 'sysdepends1') ORDER BY name
B获得所有的视图
select name, id from sysobjects where (type = 'V') AND (name != 'sysconstraints' And name != 'syssegments') ORDER BY name
C获得某表,视图的字段以及存储过程,函数的参数(使用见帮助)
sp_MShelpcolumns
D.获得表的关系(使用见帮助)
sp_MStablerefs