Tables and Fields dump
Here’s a quick way to see the user tables and fields within a database.
[sourcecode language=”sql”]
select
s.id, s.name as table_name, c.[name] as column_name, t.name as datatype, c.length, c.xprec
from
sysobjects s
inner join syscolumns c
on c.id = s.id
inner join systypes t
on t.xtype = c.xtype
where
s.type = ‘u’
order by
s.name
[/sourcecode]