Arithmetic overflow

  • Hello,

    when I try the following sql I get an error:

    select sum(datalength(memTest))

    from tblTest

    Arithmetic overflow error converting expression to data type int

    Has anyone an idea?

    Thanks.

  • Hi,

    According to BOL, DataLength returns either an int or bigint depending upon the type of the field it is examining. So what is the definition of 'memTest' and how many rows are there?

    It could be that it is going to return an int, but the accumulated value is too large for such a field.

    BrainDonor

  • Try this,

    select sum(Convert(bigint,datalength(memTest),0))

    from tblTest

    "Don't limit your challenges, challenge your limits"

  • Thanks kruti, it works.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply