Your SQL University
Home » Interview Q & A » Q10. What is meant by the error ‘String or binary data would be truncated. The statement has been terminated’?
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.
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.
Tags: String or binary data would be truncated
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Please visit SQLVERSITY.COM for more details.
Blog at WordPress.com.