Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error 'String or binary data would be truncated' in Microsoft SQL

I got this error when inserting data to Microsoft SQL.

error: ('22001', '[22001] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]String or binary data would be truncated. (8152) (SQLParamData); [01000] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The statement has been terminated. (3621)')

FYI, I use Python 2.7 and pyodbc library.

What is that error about? What should I do to solve it?

like image 783
Aminah Nuraini Avatar asked Aug 29 '16 07:08

Aminah Nuraini


Video Answer


1 Answers

Based on this link: http://www.sql-server-performance.com/2007/string-or-binary-data-truncated/

This error message appears when you try to insert a string with more characters than the column can maximal accommodate.

like image 181
Aminah Nuraini Avatar answered Oct 26 '22 16:10

Aminah Nuraini