I’m trying this from my Mac to write to a MS SQL Server database (MS SQL Server 64 bit version 13.0.4001 SP1) using the SQLDatabaseMBS class
I’m using the FreeTDSLibrary and the ODBC API to do this
Whats weird is that I can, with autocommit ON, successfully execute any single statement without error
With SQLDatabaseMBS.autocommit on, if I try to execute BEGIN TRANSACTION I get a FreeTDS error saying that after execution the open transaction count is now 1 instead of 0 (well DUH of course)
If I turn SQLDatabase.autocommit off and execute a BEGIN TRANSACTION the begin appears to execute fine
And all the statements in the transaction appear to also execute without error
Even when I finally get to the COMMIT TRANSACTION that appears to execute successfully - but there’s no data in the database (like its been rolled back)
If I comment OUT the code to begin and commit the transaction all the data ends up in the DB - but I really need the transaction to make this an all or nothing insert
Is anyone else using this configuration successfully ?