Get names, data types, description, and size of fields in table
While making documentation for Db tables, we require its field names, data types, size, and its descriptions etc system info.
So that u can just copy and paste it from result pane of sql server instead of doing copy paste from modifying table
Here is sql -query for same…Hope u found it interesting…
SELECT
[Column Name] = c.name,
sysTypes.name AS DataType ,
c.is_nullable As Nullable,
c.Max_Length AS Length ,
[Description] = ex.value
FROM
sysTypes,sys.columns c
LEFT OUTER JOIN
sys.extended_properties ex
ON
ex.major_id = c.object_id
AND ex.minor_id = c.column_id
WHERE
c.system_type_id= sysTypes.xtype AND
OBJECT_NAME(c.object_id) = TableName and sysTypes.name <> ‘sysname’
ORDER
BY OBJECT_NAME(c.object_id), c.column_id

appreciating your efforts ….looking for same … keep it up your work