Special character in Schema name in Snowflake

Viewed 95

I accidently created a schema in snowflake as {"target_db.target_schema"}. When I tried to drop this schema using drop schema "{"target_db.target_schema"}":

I am getting error as,

SQL compilation error: syntax error line 1 at position 15 unexpected 'target_db'. Is there any way to drop the schema.

2 Answers

You can double the double quotes:

drop schema "{""target_db.target_schema""}";

In such scenario the Snowsight UI is helpful:

enter image description here

Under ellipsis there is an option "Place name in SQL":

enter image description here

Which returns properly quoted name: TEST."{""target_db.target_schema""}"

Related