Norway


usually presents an error on an attempt to insert more into a field than it can hold. It typically throws an error message similar to the following:

Msg 8152, Level 16, State 14, Line 15
 String or binary data would be truncated.
 The statement has been terminated.

To prevent this (when needed, of course), you have two options:

Turn ANSI_WARNINGS off
    SET ANSI_WARNINGS {ON|OFF}

Pass through a variable

declare @testString varchar(5)
    set @testString = 'This is a long string'
    print @testString



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here