# How to generate the SQL for an incremental model in full\_refresh mode

**URL:** <https://discourse.getdbt.com/t/how-to-generate-the-sql-for-an-incremental-model-in-full-refresh-mode/9309>\
**Category:** Help\
**Tags:** incremental\
**Created:** [July 27, 2023, 10:58am UTC](https://discourse.getdbt.com/t/how-to-generate-the-sql-for-an-incremental-model-in-full-refresh-mode/9309 "2023-07-27T10:58:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott.doughty](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/scott.doughty/32/2249_2.png) [@scott.doughty](https://discourse.getdbt.com/u/scott.doughty)\
**Post date:** [July 27, 2023, 10:58am UTC](https://discourse.getdbt.com/t/how-to-generate-the-sql-for-an-incremental-model-in-full-refresh-mode/9309/1 "2023-07-27T10:58:28Z")

</div>

If I have an incremental model, how do I generate the code that would be passed to the database if I ran it as a full refresh? I know I could run `dbt run --full_refresh --select model_name_here` in my own branch and look in /target/compiled, but I’d prefer to do this without actually running anything against the database.

Thanks!

---

<div class="post-metadata">

**Author:** ![luiscristobal.lopez](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/luiscristobal.lopez/32/1642_2.png) [@luiscristobal.lopez](https://discourse.getdbt.com/u/luiscristobal.lopez)\
**Post date:** [July 27, 2023, 12:08pm UTC](https://discourse.getdbt.com/t/how-to-generate-the-sql-for-an-incremental-model-in-full-refresh-mode/9309/2 "2023-07-27T12:08:01Z")

</div>

What you are looking for is the [[dbt compile](https://docs.getdbt.com/reference/commands/compile)] command. This will compile your model without actually running it, something like a dry run.

You can use the `--select` argument to only compile the desired models `dbt compile --full_refresh --select model_name_here`. Results will be saved in the `target` folder inside your dbt project

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/a7a7ca1fe379aaf90952b0e13118a817babcd14f.png) [@system](https://discourse.getdbt.com/u/system)\
**Post date:** [August 3, 2023, 12:08pm UTC](https://discourse.getdbt.com/t/how-to-generate-the-sql-for-an-incremental-model-in-full-refresh-mode/9309/3 "2023-08-03T12:08:28Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
