# dbt-sqlserver 1.7.2 is\_incremental() not compiling and overwrites the incremental table

**URL:** <https://discourse.getdbt.com/t/dbt-sqlserver-1-7-2-is-incremental-not-compiling-and-overwrites-the-incremental-table/12110>\
**Category:** Help\
**Tags:** incremental, dbt-core\
**Created:** [February 18, 2024, 10:03pm UTC](https://discourse.getdbt.com/t/dbt-sqlserver-1-7-2-is-incremental-not-compiling-and-overwrites-the-incremental-table/12110 "2024-02-18T22:03:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maki.markie](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@maki.markie](https://discourse.getdbt.com/u/maki.markie)\
**Post date:** [February 18, 2024, 10:03pm UTC](https://discourse.getdbt.com/t/dbt-sqlserver-1-7-2-is-incremental-not-compiling-and-overwrites-the-incremental-table/12110/1 "2024-02-18T22:03:07Z")

</div>

## The problem I’m having

The incremental target table was being created on every run.

## What I’ve already tried

First i ran the model with materialized=table.  
Now that the table exists which is a pre-requisite for an incremental materialization. I changed the model materialization from table to incremental, then I got newer records from the source table to be inserted into the target table. But when I looked at the compiled models the : if is\_incremental()

```auto
select * from final
{% if is_incremental() %}
    where reference_dt > select max(reference_dt) from {{ this }}
{% endif %}

```

was not evaluated from the compiled model.

```auto
compiled model:
with final as (
    select *
    from "db"."dbo"."table_name"
) 

select * from final
;');

```
