String or binary data would be truncated: get the full picture in SQL Server 2017
SQL Server 2019 Preview (CTP 2.0) introduced a long-awaited improvement to an error message that’s been around in SQL Server for many years, but was unhelpful:
1 2 |
Msg 8152, Level 16, State 6, Procedure ProcedureName, Line Linenumber String or binary data would be truncated. |
Thanks for nothing, error message. Which table? Which column? What data? This is how the error message looks now:
1 2 3 |
Msg 2628, Level 16, State 6, Procedure ProcedureName, Line Linenumber String or binary data would be truncated in table '%.*ls', column '%.*ls'. Truncated value: '%.*ls'. |
Notice how the table, column and value are
-> Continue reading String or binary data would be truncated: get the full picture in SQL Server 2017