Error thrown when inserting data into SQL Server database using Python:
Cannot commit transaction: (3902,b'The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION. DB-Lib error message 20018, severity 16:\nGeneral SQL Server error:Check messages from the SQL Server\n')
Well, there’s no reason. But a solution was found by accident.
The error caused by the field type in sqlserver. The error I encountered is: one of the fields is set to date type. When inserting data, I report an error. Change the date type to varchar type, the problem is solved, and the data is inserted normally.
The varchar type may affect the data usage. Solve the problem first, and then solve the problem later. I think that inserting varchar data into the database is the most stable (personal experience).
Personal ability is limited, if there is a mistake welcome to correct!
- Error: current transaction is aborted, commands ignored until end of transaction blockp
- Solution of error converting data type varchar to datetime in SQL Server
- ‘Conversion failed when converting date and/or time from character string.DB-Lib error message 241,
- MySQL failed to add foreign key: SQL 1452 cannot add or update a child row:a foreign key constraint fails
- How to prevent duplicate submission
- The solution of duplicate entry ‘for key’ primary ‘when inserting data in MySQL
- java.sql.SQLException: Incorrect string value:
- E11000 duplicate key error collection in mongodb
- [Oracle] when inserting data, “ora-00001: unique constraint” appears
- ERROR 1406 (22001): Data Too Long, field len 30, data len 48
- Error attempting to get column ‘STAFF_NAME’ from result set
- Oracle error collection solution
- How to cancel the commit, how to cancel the commit after git commit, and how to change the submitted content
- About error 1005 (HY000) in MySQL: can’t create table ‘_______ ‘(errno: 150) fool’s plan
- Solve “error: failed to commit transaction” in arch Linux
- [Err] ERROR: invalid input syntax for integer: “1.0”
- SAP development and error reporting: 500 SAP internal server error (TE rmination:RABAX_ STATE)
- Perfectly solve the 1366 error of saving Chinese in MySQL
- 12-web security — error injection based on SQL Server — and, convert, cast
- 1716438 – Error :” Failed to load database information Details: The Database connector crdb_bwquery.