Solved

Error when trying to delete a row

Posted on 2007-11-14
4
1,588 Views
Last Modified: 2009-12-16
Hello all,

my website's forums built on asp.net give me a problem recently.
When new users add a new post, the post does not contain the user's id
and it gives an error on the website.
Now, I have identified the 2 posts that give me the error. Both have as user id=0
This is the mistake. When I'm trying to edit or delete these rows, I'm getting the following error message
in SQL Server Studio:

No row was updated.
The data in row 774 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 try/ press esc to cancel the changes.

Any ideas how to fix this?
0
Comment
Question by:nectarios777
4 Comments
 
LVL 8

Accepted Solution

by:
digital_thoughts earned 500 total points
ID: 20279951
Most likely you are trying to add/update a row with a value that is longer than the data field, like a varchar(50) but you are trying to but in a 60 character string.
0
 
LVL 42

Expert Comment

by:EugeneZ
ID: 20279974
<Error message: String or binary data would be truncated.>

You need enlarge your table colum size:
for example:
 you have column [Address]varchar(50)-> you need to make it varchar(1000)
0
 
LVL 1

Author Comment

by:nectarios777
ID: 20280154
Ok, my value is ntext. I have changed it to nvarchar(MAX) but I can't edit the record.
How would I delete/edit it?
0
 

Expert Comment

by:chlade
ID: 23069658
I am currently digging into the same issue.  This link provides interesting information.  I'm still looking for a little better answer, but I'm not sure if I'll find one.  (Scroll to the last comment.)

http://www.mydatabasesupport.com/forums/ms-sqlserver/141619-row-updating-error.html
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question