SQL Script Tasks
Use SQL Script tasks to run SQL statements directly against a supported datasource. SQL tasks are useful for transformations, maintenance, data quality checks, and stored procedure calls.
Prerequisites
You need an active datasource that supports SQL task execution. The connected database user or role must be able to access every object referenced by the script and perform the requested operations.
Creating a SQL Script Task
- Navigate to Tasks in the sidebar
- Click + Create Task
- Select SQL Script
- Select an active SQL-capable datasource
- Enter the statements you want to execute
- Click Run
- Verify success in the Result panel
- Click Next, name the task, and click Save Task
The datasource summary shows its database, schema, role, and warehouse when available.
Every task must run successfully before you can continue. The Next button is enabled only after the current SQL and datasource complete successfully. If you change the SQL or datasource after a successful test, run the task again before continuing.
Test Results
The Result panel shows whether the test run completed, failed, timed out, or was cancelled.
When you click Run, Supaflow saves the task in draft state and executes the SQL against the selected datasource. A successful test transitions the task to active state. An unsuccessful test keeps it in draft state.
After the task becomes active, you can run it manually, add it to an orchestration, or assign it to a schedule.
Troubleshooting
SQL Execution Fails
Problem: The Result panel shows a failed status.
Solution: Review the database error in the Result panel. Common causes include SQL syntax errors, missing objects, insufficient permissions, or unavailable database features. Test the same statements with the datasource user or role when you need to isolate a permissions or object-access problem.
Next Button Disabled
Problem: You cannot proceed from the editor step.
Solution: Click Run and wait for the current SQL and datasource to complete successfully. Any change to the SQL or datasource requires another successful test.
Datasource Is Not Available
Problem: The datasource you want to use is not listed.
Solution: Confirm that the datasource is active and supports SQL task execution.
For task naming, states, manual runs, editing, and deletion, see Tasks.
Related Pages
- Tasks - Create, run, and manage tasks
- Python Tasks - Run Snowpark Python code in Snowflake
- Orchestrations - Chain SQL tasks with pipelines and other tasks
- Activities - View task execution history
- Schedules - Automate task and orchestration runs
Support
Need help? Contact us at support@supa-flow.io