# post\_hook after\_commit getting a "The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION. (3902) " error

**URL:** <https://discourse.getdbt.com/t/post-hook-after-commit-getting-a-the-commit-transaction-request-has-no-corresponding-begin-transaction-3902-error/14684>\
**Category:** Help\
**Tags:** dbt-core\
**Created:** [August 6, 2024, 6:26am UTC](https://discourse.getdbt.com/t/post-hook-after-commit-getting-a-the-commit-transaction-request-has-no-corresponding-begin-transaction-3902-error/14684 "2024-08-06T06:26:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kybmd](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@kybmd](https://discourse.getdbt.com/u/kybmd)\
**Post date:** [August 6, 2024, 6:26am UTC](https://discourse.getdbt.com/t/post-hook-after-commit-getting-a-the-commit-transaction-request-has-no-corresponding-begin-transaction-3902-error/14684/1 "2024-08-06T06:26:05Z")

</div>

I am using dbt-core on sqlserver trying to do an incremental model  
it went fine so I went on to use pre\_hook and post\_hook to add some checkpoints  
so the header looks like this.  
{{  
config(  
materialized=‘incremental’,  
pre\_hook=before\_begin(“select something”),  
post\_hook=after\_commit(“Update Some Table”)  
)  
}}

I got it ran the first time but then when I ran again it throws this error  
(‘25000’, ‘[25000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION. (3902) (SQLExecDirectW)’)

I use sql profiler to see what is it doing but the only query is a “COMMIT”. Normally I’d see the Select statement of the model and some insert statement.

So I need some help to figure out what am I missing?  
Thanks in advance
