Recently, I attempted to insert a record into a table in SQL Server. After executing the insert query, I received the error ‘String or binary data would be truncated in table.’
String or binary data would be truncated in table
I was trying to execute the following insert query.
Declare @InitialVisitDate DATE = '2025-06-18';
INSERT INTO Appointments (PatientID, AppointmentDate, Purpose)
VALUES (
98765,
DATEADD(DAY, 1, @InitialVisitDate),
'Follow-up Consultation'
);After executing the above query, I encountered the error shown in the screenshot below.

Solution
The reason for this error VARCHAR size of the Purpose column in the Appointments table was one, but I was trying to insert a more lengthy value for the purpose column, so I got this error. Check out the screenshot below.

To fix this issue, I have updated the varchar size of the purpose column using the following query.
ALTER TABLE Appointments ALTER COLUMN Purpose VARCHAR(200);The query executed successfully as shown in the screenshot below.

The column’s varchar value has been updated successfully, as shown in the screenshot below.

Now, the same insert query has been executed successfully as shown in the screenshot below.

The same record has been successfully inserted into the table, as shown in the screenshot below.

You may also like the following articles.
- SQL Server Table Last Modified Date
- SQL Server conversion failed when converting date and/or time from character string.
- The datepart hour is not supported by date function dateadd for data type date.
- The datepart millisecond is not supported by date function dateadd for data type date.
- ‘to_date’ is not a recognized built-in function name.
After working for more than 15 years in the Software field, especially in Microsoft technologies, I have decided to share my expert knowledge of SQL Server. Check out all the SQL Server and related database tutorials I have shared here. Most of the readers are from countries like the United States of America, the United Kingdom, New Zealand, Australia, Canada, etc. I am also a Microsoft MVP. Check out more here.