Before writing a CREATE ALERT statement:
- Read
references/parameters.mdto review all available parameters and their defaults. - For each parameter, decide whether the user's request implies a non-default value.
- Include only the parameters that differ from the default or that the user explicitly requested.
- Never use
CREATE OR REPLACE— always useCREATE ALERT IF NOT EXISTSwhere supported. - Newly created alerts are suspended by default; remind the user to run
ALTER ALERT <name> RESUMEafter creation. - The
IF( EXISTS( <condition> ))block accepts SELECT, SHOW, or CALL statements; the action fires whenever one or more rows are returned. - For the
THEN <action>block, useSYSTEM$SEND_EMAILorSYSTEM$SEND_SNOWFLAKE_NOTIFICATIONfor notification-based alerts. - Omit
SCHEDULE(or set to NULL) to create a streaming alert that triggers on new data; otherwise supply a cron expression or minute interval. OR REPLACEandIF NOT EXISTSare mutually exclusive; never combine them.