When doing an insert, sourced by a select with numerous columns, and experiencing the 'string or binary data would be truncated', is there a quicker/better way or trick to identify which column in the Select statement (insert) contains a 'too-long' value, other than, the quickest way I have come up with but it still seems awfully tedious:
In a new testing block of code, structure the select statement that was sourcing the query as a derived query (or CTE), and then FROM that, selecting each column, one at a time, where len(Col) is greater than [the length of the destination table column).
Is there any trick? Has someone written some really wonderful procedural stuff that would do this for me?
I know you may laugh, but in MS Access I could have written a VBA proc in 2 minutes that would have done this, please tell me there is something in T-SQL to serve as a debugging type of tool for this scenario?