SELECT AVG([EmployeeKey]) AS [EmployeeKey] FROM [HR].[Employee];
With enough rows, that will overflow an int.
We need an option to emit this instead:
SELECT AVG( CONVERT(real, [EmployeeKey])) AS [EmployeeKey] FROM [HR].[Employee];
[ ] New type called NumericDbType. This is a subset of the built-in DbType enum.
[ ] DatabaseMetadataCache.ToSqlType(NumericDbType, int?, int?) method that will generate a database-specific type string with optional precision and scale.
[ ] Add init properties named NumericDbType, Precision, and Scale to AggregateColumn. These will be used in the BuildSelectClause method.
Say you have this aggregate.
SELECT AVG([EmployeeKey]) AS [EmployeeKey] FROM [HR].[Employee];
With enough rows, that will overflow an
int
.We need an option to emit this instead:
SELECT AVG( CONVERT(real, [EmployeeKey])) AS [EmployeeKey] FROM [HR].[Employee];
NumericDbType
. This is a subset of the built-inDbType
enum.DatabaseMetadataCache.ToSqlType(NumericDbType, int?, int?)
method that will generate a database-specific type string with optional precision and scale.init
properties namedNumericDbType
,Precision
, andScale
toAggregateColumn
. These will be used in theBuildSelectClause
method.