Snowflake doesn't accept T-sql but i'm trying to Create schema If it doesn't exists.
IF NOT EXISTS (SELECT * FROM SYS.SCHEMA WHERE NAME = 'CBS')
CREATE SCHEMA 'CBS';
How to do this in Snowflake?
Snowflake doesn't accept T-sql but i'm trying to Create schema If it doesn't exists.
IF NOT EXISTS (SELECT * FROM SYS.SCHEMA WHERE NAME = 'CBS')
CREATE SCHEMA 'CBS';
How to do this in Snowflake?
Just use the 'if not exists' syntax:
Create schema if not exists 'cbs';
It looks like you're using Matillion ETL to do this in Snowflake, in which case you have two main choices:
This method will simply fail with an error message if the schema already exists
You can parameterize the schema name in the SQL script if you want to avoid hardcoding.