Hi @Mike Gleeson ,
> SQL Error: 8525, SQLState: S0001 Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.
Quote from MS document.
Explanation
The programming model for using the Distributed Transaction Coordinator with SQL Server requires applications to explicitly enlist to and defect from a distributed transaction.
This error occurs when the following four conditions are met:
•The application has enlisted into a distributed transaction.
•The transaction has ended, either committed or rolled back, for any reason.
•The user application has not explicitly defected from a distributed transaction or explicitly enlisted into a new distributed transaction.
•The application tries to do any transactional operation other than defecting from existing distributed transaction or enlisting to a new distributed transaction, such as issuing a query or starting a local transaction.
Error state 1 is used when the application performs an operation that creates local transactions, and state 2 is used when application tries to enlist to a bound session.
User Action
After an application has enlisted into a distributed transaction, the application must explicitly defect from the distributed transaction or enlist to another distributed transaction. This will implicitly defect from a previous enlisted transaction.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".