Monday, January 26, 2009

TSQL : List Columns and Data types for a given table


select tables.name , columns.column_id, columns.name,types.name
from sys.tables tables
inner join sys.columns columns on tables.object_id = columns.object_id
inner join sys.types types on columns.user_type_id = types.user_type_id
where tables.name= 'jts_event'
order by columns.column_id

No comments: