SqlServer: Literals with real type is always considered float type #8905
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
In SSMS
We generate literal for real (C# single) & float (C# double) as
0E0
format. By default SqlServer assumes it to be float type. This forces upcasting when used inside SQL functions which causes runtime InvalidCastException.Example:
Throws
Generated SQL
Value column is mapped to real data type in server. But 0E0 is taken as float literal.
COALESCE
function uses the highest precedence data type for final result type. Which makes result of type float. But C# expectssingle
instead ofdouble
hence fails.There can be few more functions/cases like this.
The text was updated successfully, but these errors were encountered: