Solved

Error when trying to delete a row

Posted on 2007-11-14
4
1,584 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
Comment Utility
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
Comment Utility
<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
Comment Utility
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
Comment Utility
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now