select t.name as tablename,c.name as columnname,ty.name as typename, c.max_length as typelength from sys.columns c inner join sys.tables t on t.object_id=c.object_id inner join sys.types ty on ty.system_type_id=c.system_type_id order by t.name,c.column_id