Msg 8152, Level 16, State 14, Line 5
String or binary data would be truncated.
This error message appears when you try to insert a string with more characters than the column can maximal accommodate.
The T-SQL statement can be parsed, but causes the error at runtime.
Errors of the Severity Level 16 are generated by the user and can be fixed by the SQL Server user. The statement cannot be executed this way. You must either shorten the string to be isnerted to widen the column.
All versions of SQL Server.
IF OBJECT_ID(‘tempdb.#t’) > 0
DROP TABLE #t
CREATE TABLE #t
INSERT INTO #t SELECT ‘abc’
In the above example we try to insert a string ‘abc’ with a length of 3 into the column c1 of the table #t. Because c1 is of the data type CHAR(1), the error is raised.