Solved

Error when trying to delete a row

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS SQL with ODBC 5 34
Need help how to find where my error is in UFD 6 25
always on switch back after failover 2 31
Increment column based of a FK 8 19
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
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…

813 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

12 Experts available now in Live!

Get 1:1 Help Now