SELECT
    c.object_id,
    c.name,
    tp.name AS [datatype],
    c.max_length,
    c.is_computed,
    c.precision,
    c.scale AS [scale],
    c.collation_name,
    c.is_nullable,
    dc.definition,
    ic.is_identity,
    ic.seed_value,
    ic.increment_value,
    cc.definition AS [formula]
  FROM
    sys.columns c
    JOIN sys.types tp ON c.user_type_id = tp.user_type_id
    LEFT JOIN sys.computed_columns cc ON c.object_id = cc.object_id AND c.column_id = cc.column_id
    LEFT JOIN sys.default_constraints dc ON
      c.default_object_id != 0
      AND c.object_id = dc.parent_object_id
      AND c.column_id = dc.parent_column_id
    LEFT JOIN sys.identity_columns ic ON
      c.is_identity = 1
      AND c.object_id = ic.object_id
      AND c.column_id = ic.column_id