When I try that my application kills an SQL Server process, through a FireDAC connection to that SQL Server, executing a KILL command, I get an KILL command cannot be used inside user transactions
exception
FireDACConnection.Execute('KILL 65');
Ensuring that there is no transaction active before executing the command doesn't prevent FireDAC to start a new transaction, getting that error.
if FireDACConnection.InTransaction then FireDACConnection.Rollback;
FireDACConnection.Execute('KILL 65');
I have also tried to rollback the transaction inside the command, but then I get this exception Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements.
FireDACConnection.Execute('ROLLBACK; KILL 65');
How can I execute a command through FireDAC without automatically being wrapped within an user transaction ?. Thank you.