MetricSign
EN|NLRequest Access
Medium severityexecution

Power BI Refresh Error:
000826 (0A000)

What does this error mean?

A Snowflake stored procedure or scripting block exceeded the maximum number of statements allowed within a single transaction, causing the transaction to be aborted.

Common causes

  • 1A Snowflake Scripting loop executes hundreds or thousands of DML statements inside one transaction
  • 2A stored procedure iterates over a cursor and issues one INSERT or UPDATE per row
  • 3A dbt macro generates a large batch of individual statements wrapped in a single explicit transaction

How to fix it

  1. 1Step 1: Replace row-by-row loops with set-based DML: use INSERT INTO ... SELECT or MERGE instead of looping INSERT per row.
  2. 2Step 2: Break large batch operations into smaller committed transactions (e.g., commit every 500 rows using EXECUTE IMMEDIATE 'COMMIT').
  3. 3Step 3: Use temporary tables to stage intermediate results and process them in one final set-based statement.
  4. 4Step 4: Review dbt models that call macros in loops — prefer dbt-core incremental strategies (merge, delete+insert) over custom looping macros.

Frequently asked questions

What is Snowflake's maximum statement limit per transaction?

Snowflake does not publish a hard numeric limit in its standard documentation, but large looping stored procedures consistently hit throttling at a few thousand statements. Always prefer set-based operations.

Will using Snowpark Python avoid this limit?

Snowpark Python allows you to push Pandas-style transformations down to Snowflake as a single SQL plan, effectively bypassing per-statement transaction limits. It is the recommended approach for complex iterative transformations.

Other execution errors