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

A quick-and-dirty way of fixing these is to select the rows into a new physical table like so:

SELECT * INTO dbo.MyNewTable FROM <the rest of the offending query goes here>

…and then compare the schema of this table to the schema of the table into which the INSERT was previously going – and look for the larger column(s).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)