select
d.name,
a.name as 字段名,
upper(b.name) as 字段类型,
a.length as 长度,
upper((case when a.status =8 then 'null' else 'not null' end)) as 是否为空
FROM syscolumns a left join systypes b
on a.usertype=b.usertype
inner join sysobjects d
on a.id=d.id and d.type='U' and d.name<>'dtproperties'
left join syscomments e
on a.cdefault=e.id
WHERE d.name NOT LIKE 'TXN_%'
ORDER BY d.name