ColdFusion · Database exception
What does String Or Binary Data Would Be Truncated mean in ColdFusion?
SQL Server rejects an INSERT/UPDATE because a value passed from cfquery is longer than the target column's defined size — a varchar(50) column fed a 60-character string, for instance. It's a data-length mismatch rather than a type mismatch, so it survives cfqueryparam type-checking and only fails once it reaches the database.
SQL Server rejects an INSERT/UPDATE because a value passed from cfquery is longer than the target column's defined size — a varchar(50) column fed a 60-character string, for instance. It's a data-length mismatch rather than a type mismatch, so it survives cfqueryparam type-checking and only fails once it reaches the database.
Check the value length against the actual column definition before the write, or use cfqueryparam's maxlength attribute to fail fast in ColdFusion, and widen the column if truncation isn't acceptable rather than silently trimming input.