# No active warehouse selected in mart ? staging and inter work ?

**URL:** <https://discourse.getdbt.com/t/no-active-warehouse-selected-in-mart-staging-and-inter-work/10127>\
**Category:** Help\
**Created:** [September 28, 2023, 9:21am UTC](https://discourse.getdbt.com/t/no-active-warehouse-selected-in-mart-staging-and-inter-work/10127 "2023-09-28T09:21:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sclem](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@sclem](https://discourse.getdbt.com/u/sclem)\
**Post date:** [September 28, 2023, 9:21am UTC](https://discourse.getdbt.com/t/no-active-warehouse-selected-in-mart-staging-and-inter-work/10127/1 "2023-09-28T09:21:01Z")

</div>

I’m running on a error in my dbt project / snowflake. i’m creating models in staging which reference tmp table (working).  
then i join all the table i need in intermediate folder (works too) and then i create the final table in the marts section which is an incremental model.

here i’ have the following error : no active warehouse selected in the current session. Select an active warehouse with the ‘use warehouse’ command.

how can i solve this ?

here are the final model in marts which run the error

```auto
{{ config(materialized="incremental", unique_key="id_statut_produit") }}

with
source as (select * from {{ ref("inter_statuts_produits") }}),
    vcs_statuts_produits as (
        select
        md5(libelle_etat || code_lgo) as id_statut_produit,
        libelle_etat,
	    code_lgo,
	    modif_date_heure
        from source
    {% if is_incremental() %}
        where id_statut_produit >= (select max(id_statut_produit) from {{ this }})
    {% endif %}
)
select * from 
vcs_statuts_produits

```

---

<div class="post-metadata">

**Author:** ![sclem](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@sclem](https://discourse.getdbt.com/u/sclem)\
**Post date:** [September 28, 2023, 1:42pm UTC](https://discourse.getdbt.com/t/no-active-warehouse-selected-in-mart-staging-and-inter-work/10127/2 "2023-09-28T13:42:32Z")

</div>

Finded the issue had to use surrogate\_key and then modifying some option on my profile because the i defined a user which didn’t had the right to write into the base

---

<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:** [October 5, 2023, 1:42pm UTC](https://discourse.getdbt.com/t/no-active-warehouse-selected-in-mart-staging-and-inter-work/10127/3 "2023-10-05T13:42:47Z")

</div>

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