取表信息
select
sysobjects.name,sys.extended_properties.value
from
sysobjects
left join sys.extended_properties on sysobjects.id = sys.extended_properties.major_id
where type = ' U ' and sys.extended_properties.minor_id = ' 0 ' order by name
left join sys.extended_properties on sysobjects.id = sys.extended_properties.major_id
where type = ' U ' and sys.extended_properties.minor_id = ' 0 ' order by name
取字段信息
select
syscolumns.name,syscolumns.length,systypes.name
as
tname,sys.extended_properties.
[
value
]
AS
tname,syscolumns.isnullable
from
syscolumns
join systypes on syscolumns.xtype = systypes.xtype and systypes.name <> ' sysname '
LEFT OUTER JOIN sys.extended_properties ON
( sys.extended_properties.minor_id = syscolumns.colid
AND sys.extended_properties.major_id = syscolumns.id)
where syscolumns.id in
( select id from sysobjects where name = ' orderform ' )
join systypes on syscolumns.xtype = systypes.xtype and systypes.name <> ' sysname '
LEFT OUTER JOIN sys.extended_properties ON
( sys.extended_properties.minor_id = syscolumns.colid
AND sys.extended_properties.major_id = syscolumns.id)
where syscolumns.id in
( select id from sysobjects where name = ' orderform ' )