Technical Article

Catalogue of tables and fields by datatype SS2005

,

Returns the datatype, table name and field name for all user tables in the current SQL Server 2005 database.  Results are sorted by type, table and field.

--returns all fields sorted by datatype
select t.name as 'type', o.name as 'table', c.name as 'field' from
sys.columns c, sys.objects o, sys.types t
 where o.type='U' and c.object_id = o.object_id and c.system_type_id =
t.system_type_id
 order by t.name, o.name, c.name

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating