Skip to content

Commit

Permalink
Get function result scale and precision (#2709)
Browse files Browse the repository at this point in the history
* Get function result scale and precision

fixes #2705

* add missing scale with sp_describe--
  • Loading branch information
ErikEJ authored Dec 5, 2024
1 parent 8278557 commit 6b10197
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ protected override List<List<ModuleResultElement>> GetResultElementLists(SqlConn
COALESCE(ts.name, tu.name) AS type_name,
c.column_id AS column_ordinal,
c.is_nullable,
c.max_length
c.max_length,
c.precision,
c.scale
FROM sys.columns c
inner join sys.types tu ON c.user_type_id = tu.user_type_id
inner join sys.objects AS o on o.object_id = c.object_id
Expand Down Expand Up @@ -91,6 +93,8 @@ FROM sys.columns c
Ordinal = int.Parse(res["column_ordinal"].ToString()!, CultureInfo.InvariantCulture),
Nullable = (bool)res["is_nullable"],
MaxLength = maxLength,
Precision = (byte)res["precision"],
Scale = (byte)res["scale"],
};

list.Add(parameter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ private static List<List<ModuleResultElement>> GetFirstResultSet(SqlConnection c
Ordinal = int.Parse(row["column_ordinal"].ToString()!, CultureInfo.InvariantCulture),
Nullable = (bool)row["is_nullable"],
MaxLength = maxLength,
Precision = (byte)row["precision"],
Scale = (byte)row["scale"],
};

list.Add(parameter);
Expand Down

0 comments on commit 6b10197

Please sign in to comment.