Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When trying to add data to a newly created column using SQL Server Management Studio (edit rows), I am getting the following error:

No row was updated.

The data in row 1 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 cancel the change(s).

The datatype for the column is nvarchar(150).

I am inserting only a few ascii characters (example: abc).

This is someone else's database who asked me to look into it... I discovered: a) only some of the rows give this error b) the rows giving this error have long strings in two other columns (one is a nvarchar(max), and one is ntext).

share|improve this question
Is there only a single column in that table? What are the types and lengths of all the columns and what does your insert/update statement look like? – Dave Holland Mar 1 '10 at 16:23
There are multiple columns, see my update above. – Feckmore Mar 2 '10 at 14:00
up vote 2 down vote accepted

I've experienced this on occasions when a table had a mixture of ntext and nvarchar(MAX) datatypes. Changing all the ntexts to nvarchar(MAX)s fixes the problem.

share|improve this answer

This error typically occurs when you exceed the length of the data type for the column. Are you inserting more than 150 characters into the column?

share|improve this answer
I'm only inserting a few characters. I updated some new findings in the post. – Feckmore Mar 2 '10 at 14:00
Hmmm - It’s possible to ignore the 'String or binary data would be truncated' message by setting ANSI_WARNINGS to OFF. This will truncate fields where they don’t fit. ANSI_WARNINGS OFF has drawbacks and it is better to correct a problem rather than ignore it. Another thing to check is whether the table update is firing any triggers that insert or update another table. – Brian Knight Mar 2 '10 at 14:07

I got this error when I mistakenly exceeded the number of characters that a field could hold. In Visual Studio, I had mistakenly inserted a field with its datatype as nvarchar(1) and was trying to save a word with 6 characters to that field. Once I changed to nvarchar(50), it worked fine. Hope this helps someone.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.