MSSQL – Determine the type of a column

——————————————————————————————–

— MSSQL – Determine the type of a column

——————————————————————————————–

select col.name as ‘columnname’,t.name as ‘type’, ”, * FROM sys.columns col LEFT JOIN sys.extended_properties p ON p.minor_id = col.column_id AND p.major_id = col.object_id JOIN sys.sysobjects tab ON col.object_id = tab.id AND tab.xtype = ‘U’

JOIN sys.types t ON col.user_type_id = t.user_type_id where

tab.name like ‘%table%’ and

col.name like ‘%column%’

MSSQL – Determine the type of a column

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s