String or binary data would be truncated (Silly Sunday 2023-01-08)

Microsoft introduced the trace flag 460 for certain CU/patch and higher versions of SQL Server 2016/2017, to finally address the issue that's plagued almost everyone who's ever worked with SQL Server: the dreaded "String or binary data would be truncated" on an insert statement with no context given as to the column it's failed for.

Beyond frustrating -- especially since it's clear that the database engine 'knows' internally which column has failed!

Different people have their own way of tracking this down, although I've found no better strategy than the "divide and conquer" approach: narrow down the list of columns by half and then essentially do a binary search on it. (Assuming I don't have any business context as to the likely culprit, of course.)

This is now enabled by default from SQL Server 2019 (compatibility level 150) onwards.