Msg 8152, Level 16, State 14, Line 5
String or binary data would be truncated.
Surprisingly, it may be misunderstood that there is no more to do. First of all, this error occurs because the new data to be inserted or updated cannot be placed into the column due to the data size is beyond the column size. This situation may only be a consequence of a poor database design, so should it be altered the size of the column? if so, are there indexes for this column? what happens with the statistics linked to the column? many things to take into consideration if we wanted to alter the column to give a final solution to this issue, and obviously, that is why the impact on the performance is of paramount importance. By and large, this is not highly advisable to turn off ANSI options as it may cause RECOMPILATION for each stored procedure where it was turned off, therefore, it may impact the performance detrimentally and the knock-on effect might be regrettable. So, we should avoid turning off not only ANSI_WARNINGS but also the following ones which will cause the same effect.
- SET ANSI_DEFAULTS
- SET ANSI_NULLS
- SET ANSI_PADDING
- SET CONCAT_NULL_YIELDS_NULL
No comments:
Post a Comment
Let me know any remarks or questions you may have. Please write down your name.