(pymssql._pymssql.OperationalError) (8152, b'String or binary data would be truncated.DB-Lib error message 20 018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n')
(pymssql._pymssql.OperationalError) (8152, b'String or binary data would be truncated.DB-Lib error message 20 018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n')
上面這種情況是因為我們SQLServer中設置的字段的長度不夠導致(或者說是我們存的數據超出了字段設置的長度范圍),所以只需要調整數據庫對應字段的長度,我這里之前設置的是varchar(255),現在改為text類型,就完美解決了。

浙公網安備 33010602011771號