Cause 1: Multiple Active Result Sets (MARS) with nested transactions
The most common trigger for 0XC0190037 is using MARS (Multiple Active Result Sets) with a connection that has an open transaction, then trying to execute another command that starts a new transaction on the same connection. This often shows up in applications using SqlConnection with MultipleActiveResultSets=True in the connection string.
Here's a typical scenario: you have a data reader open, and inside that loop you try to execute an UPDATE statement. The UPDATE needs its own transaction, but the existing transaction from the reader can't be broken because the reader is still active. SQL Server raises 0XC0190037.
How to fix it
- Turn off MARS if you don't truly need it. Change your connection string from
MultipleActiveResultSets=TruetoFalseor remove it. Restart your application and test. - If you must keep MARS, avoid nesting transactions. Use
SqlTransactionwith theTransactionScopecarefully, and ensure that you don't start a new transaction while a reader is open. - Use
CommandBehavior.SingleResultorSequentialAccessto reduce the time the reader stays open.
After disabling MARS, you should see the error disappear. If it persists, move to the next cause.
Cause 2: Bound sessions or session multiplexing
Another common source is using bound sessions (via sp_getbindtoken and sp_bindsession) or older connection pooling tricks that share transactions across sessions. When a session tries to break the binding mid-transaction, SQL Server throws this error.
This is rare in modern apps, but if you're supporting legacy code that uses these stored procedures, that's likely the culprit.
How to fix it
- Search your codebase for
sp_getbindtokenorsp_bindsessioncalls. If found, replace them with a modern approach: useTransactionScopeor a single connection with an explicit transaction. - If you can't change the code, ensure that you always unbind (call
sp_unbindsession) before the transaction ends. Missing that call is what breaks the dependency.
Once you remove the binding calls, the error should stop. But there's one more cause that sneaks up on people.
Cause 3: Implicit transactions with triggers or stored procedures
Sometimes 0XC0190037 appears when you have SET IMPLICIT_TRANSACTIONS ON and a trigger or stored procedure tries to start a new transaction while one is already open. The engine can't break the dependency because the outer transaction is still in progress.
I've seen this happen with data import scripts that use linked servers. The linked server query starts its own distributed transaction, but the local transaction can't be suspended.
How to fix it
- Check if
SET IMPLICIT_TRANSACTIONSis on in your session or in the stored procedure. RunSELECT @@OPTIONS & 2— if it returns 2, that setting is enabled. - If you don't need it, turn it off with
SET IMPLICIT_TRANSACTIONS OFFat the start of your batch. - For triggers, review the trigger code for
BEGIN TRANSACTIONstatements. They shouldn't start new transactions — they should rely on the parent transaction. Remove any explicit transaction commands in triggers.
After turning off implicit transactions or cleaning the trigger code, test again. The error should be gone.
Quick-reference summary table
| Cause | Fix | Check |
|---|---|---|
| MARS with nested transactions | Disable MARS or restructure code | Connection string |
| Bound sessions | Remove sp_getbindtoken/sp_bindsession | Search code |
| Implicit transactions or triggers | Turn off IMPLICIT_TRANSACTIONS, remove BEGIN TRAN in triggers | @@OPTIONS, trigger code |
Start with the MARS fix — it's the most common. Then move down the list. If none of these apply, check the SQL Server error log for the exact stack trace to see which module triggered the error. That will point you to the specific session or stored procedure.