SELECT
c.name columnName,CONVERT(varchar(200), ex.value) comments,
t.name dataType,
c.max_length dataLength,(case c.is_nullable when'1'then'YES'WHEN'0'then'NO'ELSE''END)nullable
FROM
sys.columns c
LEFTOUTERJOIN
sys.extended_properties ex
ON
ex.major_id = c.object_id
AND ex.minor_id = c.column_id
AND ex.name ='MS_Description'leftouterjoin
systypes t
on c.system_type_id=t.xtype
WHERE
OBJECTPROPERTY(c.object_id,'IsMsShipped')=0AND OBJECT_NAME(c.object_id)='tabuser'