16
Insufficient result space for %S_MSG conversion of %s value '%s' to a %s field.
Error 265 can be raised when:
Conversions to character data fails with error 265 if you attempt a conversion that would cause data truncation.
Certain system stored procedures are executed.
This section describes scenarios under which error 265 occurs and procedures that you can use to resolve the error.
Conversions of integer to character data fail if the target format is not large enough to accommodate the data:
1> select convert (char(1), 500) 2> go
Msg 265, Level 16, State 1: Server 'mfg1', Line 1: Insufficient result space for explicit conversion of INT value '500' to a CHAR field.
To correct this problem, choose a larger target format (char(3
)
in the example).
Conversions of floating point to character data will fail if the target format is not large enough to accommodate the data:
1> select convert (char(10), 3.1415e) 2> go
Msg 265, Level 16, State 1: Server 'mfg1', Line 1: Insufficient result space for explicit conversion of FLOAT value '3.1415000000000002' to a CHAR field.
In this example, the trailing part of the source value reported in the error message can be different from the entered value. This is because FLOAT is an approximate numeric datatype whose internal representation (and rounding upon display) are platform-dependent.
To correct this problem, choose a larger target format for display. Use the str function to determine the necessary format. The required format varies depending upon the number being converted and the accuracy of floating point numbers supported by your platform. To guarantee success, use a target of 25 characters.
If loss of precision (rather than display format) is a concern in the application, consider using an exact numeric datatype such as integer, numeric or decimal.
Refer to the Transact-SQL User's Guide for details about the str function.
All versions