Home » Interview Q & A » Q10. What is meant by the error ‘String or binary data would be truncated. The statement has been terminated’?

Q10. What is meant by the error ‘String or binary data would be truncated. The statement has been terminated’?

Our Categories

Blog Stats

  • 32,852 hits

Calendar

June 2013
M T W T F S S
« May    
 12
3456789
10111213141516
17181920212223
24252627282930

Please visit SQLVERSITY.COM for more details.

This is the common error in SQL Server when we are inserting or updating the data. When you are get this error for the first time, you will not be in a position to understand what it is 🙂

You get this error when you are trying to INSERT or UPDATE the data, whose length is more than the length of the column which you have defined in the table.

Ex:

Let us say, the DepartmentName column in Department table is defined as Varchar(5). But you are trying to INSERT ‘ABCDEFG’ value into DepartmentName column.

You will get this error since you are trying to INSERT a value whose length is 7 characters into the column which was defined as Varchar(5).

To resolve this error, reduce the length of the value which you are inserting or ALTER the table to increase the size of the DepartmentName column.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: