1

I am wanting to insert rows into a four column table. I have inserted rows in the first two columns. However, when I try adding to the third and fourth column I receive the following error,

"Msg 8152, Level 16, State 4, Line 1 String or binary data would be truncated. The statement has been terminated"

I am using the following query:

USE DB
GO
INSERT INTO dbo.Table (Column1, Column2, Column3,Column4)
VALUES ('data','data','data','data')

2 Answers 2

1

Check if one of your strings exceeds the length of the datafield. For example, if you are inserting a string of length 50 into a varchar(20), you would recieve this error.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I increased the column size and that resolved the issue.
1

You are receiving that error because your columns are not capable of storing a value that large. You need to either shorten the length of your strings being inserted or increased the length on the column structure.

1 Comment

Thanks for your help. I increased the length on the column structure and that resolved the error.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.