# Schema is getting clubbed from profiles.yml and config in the sql model

**URL:** <https://discourse.getdbt.com/t/schema-is-getting-clubbed-from-profiles-yml-and-config-in-the-sql-model/17711>\
**Category:** Help\
**Tags:** dbt-core\
**Created:** [January 14, 2025, 2:36am UTC](https://discourse.getdbt.com/t/schema-is-getting-clubbed-from-profiles-yml-and-config-in-the-sql-model/17711 "2025-01-14T02:36:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rookie111](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@rookie111](https://discourse.getdbt.com/u/rookie111)\
**Post date:** [January 14, 2025, 2:36am UTC](https://discourse.getdbt.com/t/schema-is-getting-clubbed-from-profiles-yml-and-config-in-the-sql-model/17711/1 "2025-01-14T02:36:35Z")

</div>

## The problem I’m having

I have defined schema default one in profiles.yml, and i am passing config in sql model, so when dbt creates a view in snowflake, it should pick the schema from the config in sql instead of profiles.yml  
however when i run it clubs the 2, this is happening locally

## The context of why I’m trying to do this

{{ config(  
materialized=‘view’,  
schema=‘SAMPLE’,  
alias=‘SAMPLE\_V’,  
copy\_grants=true  
) }}

SELECT  
\*  
FROM DBO.TRANSACTION\_ALL\_V  
LIMIT 100

so when creating it clubs from profiles.yml  
so in profiles.yml has schema=‘dev\_schema’  
and when it creates it clubs dev\_schema with SAMPLE.

## What I’ve already tried

## Some example code or error messages

no error message, it just creates wrong schema and when deploying creates a new schema in snowflake

```auto
Put code inside backticks
  to preserve indentation
    which is especially important 
      for Python and YAML! 

```

---

<div class="post-metadata">

**Author:** ![a\_slack\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/a_slack_user/32/1629_2.png) [@a\_slack\_user](https://discourse.getdbt.com/u/a_slack_user)\
**Post date:** [January 14, 2025, 4:35am UTC](https://discourse.getdbt.com/t/schema-is-getting-clubbed-from-profiles-yml-and-config-in-the-sql-model/17711/2 "2025-01-14T04:35:57Z")

</div>

This is going to be related to the generate schema name macro.  
By default, it should be putting it in dev\_schema\_sample  
unless you edit the generate schema name macro to get it to behave differently.  
How are you separating each developers Dev environment? The two main ways are by schema namespace or by database/catalog. Having dev\_schema in your profiles .yml indicates to me you may have a setup where each developer is writing to the same space, which will cause you headaches and loses a lot of the dbt benefit.

Note: `@Meagan` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1736829349577789?thread_ts=1736822218.320769&cid=CBSQTAPLG). It might not have transferred perfectly.

---

<div class="post-metadata">

**Author:** ![a\_slack\_user](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/a_slack_user/32/1629_2.png) [@a\_slack\_user](https://discourse.getdbt.com/u/a_slack_user)\
**Post date:** [January 14, 2025, 8:00am UTC](https://discourse.getdbt.com/t/schema-is-getting-clubbed-from-profiles-yml-and-config-in-the-sql-model/17711/3 "2025-01-14T08:00:16Z")

</div>

Here’s the docs for this: [https://docs.getdbt.com/docs/build/custom-schemas](https://docs.getdbt.com/docs/build/custom-schemas)

Note: `@Mike Stanley` originally [posted this reply in Slack](https://getdbt.slack.com/archives/CBSQTAPLG/p1736841603106489?thread_ts=1736822218.320769&cid=CBSQTAPLG). It might not have transferred perfectly.
