# How to get the current schema

**URL:** <https://discourse.getdbt.com/t/how-to-get-the-current-schema/3635>\
**Category:** Archive\
**Created:** [January 14, 2022, 4:05am UTC](https://discourse.getdbt.com/t/how-to-get-the-current-schema/3635 "2022-01-14T04:05:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xzheng](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/xzheng/32/1694_2.png) [@xzheng](https://discourse.getdbt.com/u/xzheng)\
**Post date:** [January 14, 2022, 4:05am UTC](https://discourse.getdbt.com/t/how-to-get-the-current-schema/3635/1 "2022-01-14T04:05:07Z")

</div>

Hi,  
anyone can help on this? in the dbt\_project.yml, i set different model folder to be created in different schema. now want to get current schema during the model create, how would i do that? tried {{target.schema}}, but it doesn;t work. my dbt\_project.yml is seting as below, for the model/snapshot folder, i put target\_schema and schema to be “semantic\_snapshot”. but when use {{target.schema}}, it always return other schema? i am expect to see semantic\_snapshot.  
also, what would be the difference between +target\_schema and +schema?  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/getdbt/original/1X/5504ba0542091788b0eea08ce80e4fea19dc2414.png)  
Thanks so much for the help.  
ALEX

---

<div class="post-metadata">

**Author:** ![reub](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@reub](https://discourse.getdbt.com/u/reub)\
**Post date:** [January 24, 2022, 9:01am UTC](https://discourse.getdbt.com/t/how-to-get-the-current-schema/3635/2 "2022-01-24T09:01:02Z")

</div>

Hi xzheng,

Just a guess… but I suspect that as it’s a configuration you may need to use {{ config.get(‘target\_schema’) }}

From the docs… I’m guessing that +schema is ignored/ not available for snapshots, and that the difference is that snapshots are setup to allow you to put them in a different database & schema from the rest of the dbt project.
