Error 265

Severity

16

Message text

Insufficient result space for %S_MSG conversion  of %s value '%s' to a %s field. 

Explanation

Error 265 can be raised when:

Action

This section describes scenarios under which error 265 occurs and procedures that you can use to resolve the error.


Errors in integer conversion

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).


Errors in floating point conversion

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.

Additional information

Refer to the Transact-SQL User's Guide for details about the str function.

Versions in which this error is raised

All versions