# Model to Create or Drop Snowflake tables

**URL:** <https://discourse.getdbt.com/t/model-to-create-or-drop-snowflake-tables/9783>\
**Category:** Help\
**Tags:** dbt-cloud\
**Created:** [August 31, 2023, 3:48am UTC](https://discourse.getdbt.com/t/model-to-create-or-drop-snowflake-tables/9783 "2023-08-31T03:48:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![siva.chaitanya.p](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@siva.chaitanya.p](https://discourse.getdbt.com/u/siva.chaitanya.p)\
**Post date:** [August 31, 2023, 3:48am UTC](https://discourse.getdbt.com/t/model-to-create-or-drop-snowflake-tables/9783/1 "2023-08-31T03:48:48Z")

</div>

## The problem I’m having

Couldn’t create backup tables through a dbt model, Is there a way I create backup tables directly, at the moment when I trigger model a view is getting created which is causing issue as we have create table inside Creaview.

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

I want to backup my tables before I drop few as part of recovery process

## What I’ve already tried

I tried to Create backup using a Model but when trigger dbt run --select Backup.sql

## Some example code or error messages

Snowflake adapter: Snowflake error: 001003 (42000): SQL compilation error:  
syntax error line 6 at position 8 unexpected ‘CREATE’.  
On model.stack\_schema\_name.BACKUP: create or replace view DATABASE\_NAME.SCHEMA\_NAME.BACKUP

copy grants as (  
– Update the below parameters for any new model starts ----- select query generated using macro, replaced with the dbt sources to get the lineage

```
    CREATE TABLE IF NOT EXISTS DATABASE_NAME.SCHEMA_NAME.TBL_BKP_30082023 AS SELECT * FROM DATABASE_NAME.SCHEMA_NAME.TBL;
	CREATE TABLE IF NOT EXISTS DATABASE_NAME.SCHEMA_NAME.TBL_BKP_30082023 AS SELECT * FROM DATABASE_NAME.SCHEMA_NAME.TBL

```

…   
2023-08-30 05:58:41.106449 (Thread-4): 05:58:41 Opening a new connection, currently in state closed
