Error Message: String or binary data would be truncated.

  • Three databases that were forced restored now do nor allow manual entry, even one single character, although using an update statement works. This is not a matter of changing the length of the datatype, but something else. For the life of me, I can't figure out why this mere attempt at manual data entry generates the error below:

    "No row was updated.

    The data is row 2 was not committed.

    Error Source: >Net SqlClient Data Provider.

    Error Message: String or binary data would be truncated.

    The statement has been terminated.

    Correct the errors and retry or press ESC to changes the change(s).

    Why does this message speak about truncating when only one character is entered?

    We are using SQL Server 2005 SP 2

    Jim

  • Run a Trace, SQL Profiler, when you attempt to edit the data in SSMS, then my guess is you will see an update statement with your one character followed by spaces that are already in the column.

    In SSMS you can do a select all in the cell, and I'm betting there are spaces in there, delete and then enter the new characters.

  • Jack,

    If you are right then every one of our hundred of columns in our hundred of tables needs to have such extra characters deleted, since I cannot manually enter data in ANY column. Besides, before I tried the manual entry I pressed the delete button to delete the pressumed unseen spaces, and it still wouldn't accept manual entry.

    Jim

  • Have you run Profiler like I suggested to see what is happening behind the scenes? All SSMS is doing is issuing an update statement so there has to be something else in the data.

  • How does one run a trace on a single cell of a column?

    Jim

  • You can't. You just run a trace a trace using the Standard Template (be sure to include the TextData column for the RPC completed event) and add filters on Database ID, and for application like Microsoft SQL Server Management Studio.

    Attached is a zip file with a template. You just need to change the filter on DatabaseID. Put the template in C:\Documents and Settings\[your user name here]\Application Data\Microsoft\SQL Profiler\9.0\Templates\Microsoft SQL Server\90 and it will show up in Profiler.

    Once you have profiler running, open SSMS connect to the DB and do an update. YOu should find and RPC:Completed event with TextData like sp_execute_sql 'Update statement', 'Parameter Defintion', Paramter list.

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

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