Board logo

标题: SQL 查询所有表名、字段名、类型、长度、存储过程、视图 [打印本页]

作者: erina.pan    时间: 2016-12-6 11:33     标题: SQL 查询所有表名、字段名、类型、长度、存储过程、视图

-- 获得存储过程创建语句select o.xtype,o.name,cm.text from syscomments cm inner join sysobjects o on o.id=cm.id where xtype ='p'order by o.xtype,o.name,cm.text   -- 获得视图程创建语句select o.xtype,o.name,cm.text from syscomments cm inner join sysobjects o on o.id=cm.id where xtype ='v'order by o.xtype,o.name,cm.text   -- 查询所有表名、字段名、类型、长度select o.name, c.name,t.name,c.length from syscolumns cinner join systypes t on c.xtype= t.xtypeinner join sysobjects o on c.id= o.idwhere   o.xtype='u'order by  o.name, c.name,t.name -- 所有数据都来自于这四张表--select * from sysobjects  --select * from syscolumns--select * from syscomments--select * from systypes




欢迎光临 赛捷软件论坛 (http://sagesoft.cn/bbs/) Powered by Discuz! 7.2