String or binary data would be truncated

  • I am coming across a problem in one of the sites, that I am not getting at my office.

    I have set up transaction replication and one of the columns in the tables is a Float and during the data insertion The below is the SP called and the data that is inserted.

    CALL sp_MSins_transfer_lab_orders (3, '20020305NIHT0004', 26, 336, '200203050000319933', '1053020 ', 'Gonzalez Graciela', 'Femenino', '1947/01/04', 'OP0001 ', 'OP', 4, 'Consulta', 'xxx', 'Hemoglobina', 'x', 262, 'L', 'U', 1.000000000000000e+000, '2002/03/05', '09:34', 98, 'Hematología', 'NIHT', 0, '', 0, '', 0, '', 0, 'xxx', ' ', 'María Teresa Almada', NULL, 'Y', 'N', 631, '2002/03/06', '07:03')}

    Transactional replication Fails with an error “String or binary data would be truncated”

    Error No: 8152 for which I am not able to get help from the Books on line and also from the Microsoft

    Support site.

    The regional setting for the Desktop where the data is been sent to the database server has changes

    That is:

    The decimal separation is ‘.’ Instead of ‘,’

    Example : $7,000.00 is read and sent as $7.000,00 (Spanish setting)

    Could this be the problem.Has any body come across this kind of problem.

  • Have you tried replacing the value with a 0 to see if the proc works then? Any chance someone has modified a column width on either publisher or subscriber?

    Andy

  • The datatype and the lenght of all the columns in the Publisher and subscriber is the same.What i am suspecting is the data for one of the column which has a Float datatype and the data that is inserted is exponential "1.000000000000000e+000" .Could this be the problem.

  • I would say that is most likely the case. Try it wrapped in ' quotes, SQL gets weird about certain data types and data entered like dates where if you enter 2002/03/05 it tries to divide it but if you put the in ' quotes it will parse properly as the date.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • I just tried and got no issue wither way, so I still suggest test. If still fails can you post the DDL of your table so I can test better against what you are doing?

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • I have seen that exact problem with regional settings. Your computer is giving a datetime in a format the sql may not be able to interpret as a datetime.

    The floating point type can handle the e notation ( at least with my setup is does )

    Try the dates with the standard mm/dd/yyyy format.

    Good luck

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply