Data Exceptions

Data exceptions occur when an entry is too long for its datatype, or contains an illegal escape sequence or other format errors.

Message

Value

Description

Arithmetic overflow occurred.

22003

Occurs when:
  • An exact numeric type would lose precision or scale as a result of an arithmetic operation or a sum function.

  • An approximate numeric type would lose precision or scale as a result of truncation, rounding, or a sum function.

Data exception – string data right truncated.

22001

Occurs when a char, unichar, univarchar, or varchar column is too short for the data being inserted or updated and non-blank characters must be truncated.

Divide by zero occurred.

22012

Occurs when a numeric expression is being evaluated and the value of the divisor is zero.

Illegal escape character found. There are fewer bytes than necessary to form a valid character.

22019

Occurs when you are searching for strings that match a given pattern if the escape sequence does not consist of a single character.

Invalid pattern string. The character following the escape character must be percent sign, underscore, left square bracket, right square bracket, or the escape character.

22025

Occurs when you are searching for strings that match a particular pattern when:
  • The escape character is not immediately followed by a percent sign, an underscore, or the escape character itself, or

  • The escape character partitions the pattern into substrings whose lengths are other than 1 or 2 characters.

Related reference
sum