# dbt fabric pre hook macro insert give error

**URL:** <https://discourse.getdbt.com/t/dbt-fabric-pre-hook-macro-insert-give-error/19965>\
**Category:** Help\
**Created:** [July 28, 2025, 5:14pm UTC](https://discourse.getdbt.com/t/dbt-fabric-pre-hook-macro-insert-give-error/19965 "2025-07-28T17:14:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bart0209](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/bart0209/32/5894_2.png) [@Bart0209](https://discourse.getdbt.com/u/Bart0209)\
**Post date:** [July 28, 2025, 5:14pm UTC](https://discourse.getdbt.com/t/dbt-fabric-pre-hook-macro-insert-give-error/19965/1 "2025-07-28T17:14:35Z")

</div>

I get an error when I want to insert a record into a table using a pre-hook macro.

(‘42000’, “[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Incorrect syntax near ‘\<’. (102) (SQLExecDirectW)”)

dbt with Fabric

The pre\_hook macro.

{%- macro custom\_pre\_hook\_fabric() -%}

INSERT INTO [VGC].[BRONZE].[m\_model\_exec]  
(  
m\_model\_exec\_id,  
m\_model\_name,  
m\_invocation\_id,  
m\_job\_exec\_id,  
m\_model\_start\_end,  
m\_row\_count  
)  
VALUES (‘debug’,‘debug’,‘debug’,‘debug’,CURRENT\_TIMESTAMP,0);

{%- endmacro -%}

The dbt model works fine without the pre\_hook macro. When I and the pre\_hook in the config it fails?
