728x90
select  a.name as table_name,
           b.name as column_name,
           c.name +' (' + cast(b.length as varchar) + ')' as column_type,
           'Rs.Fields(' + cast((b.colid - 1) as varchar)+ ')' as sorting_order
from      dbo.sysobjects a, dbo.syscolumns b, dbo.systypes c
where   a.id = b.id
and      a.name like 'tbl_%'
and      b.xtype = c.xtype
order by a.name, colid 

+ Recent posts