SQL Server Performance

SQL2000 + ColdFusion: "...data would be truncated"

Discussion in 'General Developer Questions' started by erose, Apr 15, 2005.

  1. erose New Member

    I'm having an odd issue with a web app using SQL2000 and ColdFusion. On an SQL INSERT... statment, I get the error:


    [Macromedia][SQLServer JDBC Driver][SQLServer]String or binary data would be truncated.

    The data I'm inserting fits the db table (7-character string into a varchar(255) field, values of 0 or 1 into tinyint fields, etc).

    I've tried breaking the query into smaller pieces, but even inserting a single field at a time results in the same error.

    Eddie Roosenmaallen, Developer
    DAS Software Inc.
    www.das.ca
  2. satya Moderator

    Try


    SET ANSI_WARNINGS OFF
    ...
    Your query
    ..
    SET ANSI_WARNINGS ON

    To work around this problem, either define the column in the table to accept the values or you can trim or convert the values before you insert them.

    Satya SKJ
    Moderator
    http://www.SQL-Server-Performance.Com/forum
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  3. erose New Member

    Awesome, that appears to have done the trick.

    Thanks!

    Eddie Roosenmaallen, Developer
    DAS Software Inc.
    www.das.ca
  4. banna_03 New Member

    Thanks too.

Share This Page