复制代码代码如下所示:
选择
表名= object_name(c.object_id),
columnsname = c.name,
描述= ex.value,
塔式= t.name,
长度= c.max_length
从
sys.columns C
左外连接
sys.extended_properties前
在
ex.major_id = c.object_id
和ex.minor_id = c.column_id
和ex.name = 'ms_description
左外连接
Systypes T
在c.system_type_id = t.xtype
哪里
客体(c.object_id,'ismsshipped)= 0
和object_name(c.object_id)= 'tablename



1。获取所有数据库名称:
选择名字中订购的名字..
2。获取所有表名:
从数据库中选择的名字..在xtype = 'u'order的名字
xtype = U:代表所有用户表;
xtype =:代表所有系统表;
三.获取所有字段名:
选择名称列的id是object_id('tablename)