Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Error Message: String or binary data would be truncated. Expand / Collapse
Author
Message
Posted Friday, December 5, 2008 7:02 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 5, 2008 11:06 AM
Points: 5, Visits: 14
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
Post #614492
Posted Friday, December 5, 2008 7:25 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 10:50 AM
Points: 11,264, Visits: 13,022
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 Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #614518
Posted Friday, December 5, 2008 7:37 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 5, 2008 11:06 AM
Points: 5, Visits: 14
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
Post #614536
Posted Friday, December 5, 2008 7:53 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 10:50 AM
Points: 11,264, Visits: 13,022
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.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #614561
Posted Friday, December 5, 2008 8:39 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 5, 2008 11:06 AM
Points: 5, Visits: 14
How does one run a trace on a single cell of a column?

Jim
Post #614622
Posted Friday, December 5, 2008 9:09 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 10:50 AM
Points: 11,264, Visits: 13,022
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.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2


  Post Attachments 
Standard With Filters on DatabaseId and ApplicationName For Management Studio.zip (1 view, 540 bytes)
Post #614652
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse