Is there any good way to debug "String or binary data would be truncated?"

Viewed 9150

The year is 2010.

SQL Server licenses are not cheap.

And yet, this error still does not indicate the row or the column or the value that produced the problem. Hell, it can't even tell you whether it was "string" or "binary" data.

Am I missing something?

10 Answers

The best thing that worked for me was to put the rows first into a temporary table using select .... into #temptable Then I took the max length of each column in that temp table. eg. select max(len(jobid)) as Jobid, .... and then compared that to the source table field definition.

Related