Sunday, March 17, 2019

Arithmetic overflow error converting expression to data type int.


Try commenting out various aggregations to identify the problem with

SUM(someIntegerMeasure)

The sum is exceeding the maximum int. Try replacing it with

SUM(CAST(someIntegerMeasure AS BIGINT))

No comments:

Post a Comment

Recently Executed queries

 SELECT     txt.TEXT AS [SQL Statement],     qs.EXECUTION_COUNT [No. Times Executed],     qs.LAST_EXECUTION_TIME AS [Last Time Executed],   ...