Create a simple SQL task ( non scheduled )
create task MyTask1 WAREHOUSE = COMPUTE_WH as (select * from test1);
Create a simple Task scheduled every morning 9 am, LA time.
create task MyTASK2 SCHEDULE = 'USING CRON 0 9 * * * America/Los_Angeles' WAREHOUSE = COMPUTE_WH as (select * from test1);
Create a simple Task scheduled every 2 minutes :
CREATE TASK mytask_minute WAREHOUSE = mywh SCHEDULE = '2 MINUTE' AS INSERT INTO mytable(ts) VALUES(CURRENT_TIMESTAMP);
By default, all tasks are suspended once created, to enable them, you will need to resume them.
display all tasks :
ALTER TASK task_one RESUME;
If you wish to run Task MyTask4 after Task Root (MyTASK2 ), root ( MyTASK2 ) needs to be suspended first :
ALTER TASK MyTASK2 SUSPEND;
create task MyTask4 WAREHOUSE = COMPUTE_WH after MyTASK2 as (select * from test1) ;
Resume all dependent tasks that are children of a root task with a case-insensitive name: