Before writing a CREATE TASK 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 TASK IF NOT EXISTSwhere supported. - Newly created tasks are always suspended; remind the user to run
ALTER TASK <name> RESUMEafter creation. - Root and standalone tasks require a
SCHEDULE; child tasks (those withAFTER) must not have one. - Prefer serverless compute (omit
WAREHOUSE, setUSER_TASK_MANAGED_INITIAL_WAREHOUSE_SIZE) unless the user explicitly requests a named warehouse. - Only one task should consume from any given stream; advise creating separate streams for multiple consumers.
AUTOCOMMITmust be TRUE for DML statements executed inside a task.