0

SQL: get max length of values in every table column

SQL to get max length of values in every table column

I had an issue to resolve once upon a time where data could not be loaded into a table because “string or binary data would be truncated”.

The target table had well over 50 columns with several million rows.

The only easy way to figure out what incoming data was longer than the specified schema was to implement the following SQL.