MetricSign
EN|NLRequest Access
Medium severitydata flow

Power BI Refresh Error:
DF-Executor-IncorrectQuery

What does this error mean?

The SQL query defined in the data flow source transformation contains a syntax error or uses SQL constructs that are not supported in ADF Mapping Data Flow source mode. The database rejected the query at parse time before any rows were read.

Common causes

  • 1The source query uses CTEs (WITH clauses), stored procedure calls, or DML statements (INSERT/UPDATE/DELETE) which are not supported in data flow source queries — only plain SELECT statements are allowed
  • 2A SQL syntax error in the query: a missing comma, an incorrect column alias, a reserved word used as a column name without quoting, or unsupported database-specific syntax
  • 3A pipeline parameter interpolated into the source query produces invalid SQL — for example, a date parameter that resolves to a format the database cannot parse
  • 4The query references a table or view that no longer exists because of a recent database schema change

How to fix it

  1. 1Open the source transformation in ADF Studio, switch to 'Query' input mode, and copy the SQL query — run it directly against the source database in a query tool (SSMS, Azure Data Studio) to see the exact database error.
  2. 2Check for unsupported SQL syntax — ADF data flow source queries must be a simple SELECT statement; subqueries, CTEs, and INSERT/UPDATE/DELETE statements are not supported in data flow source mode.
  3. 3If the query uses ADF pipeline parameters (e.g., @pipeline().parameters.startDate), verify the parameter resolves to a valid string — use ADF debug mode to inspect resolved parameter values.
  4. 4Confirm the referenced tables and columns still exist in the source database — a schema change (renamed table, dropped column) in the source will invalidate the query.
  5. 5Enable debug mode and preview the source transformation with a row limit to test the query at runtime.

Frequently asked questions

How do I test the source query before running the full data flow?

Copy the SQL from the ADF source transformation and run it directly in SSMS or Azure Data Studio. The database error is more descriptive than ADF's — fix the SQL there, then paste it back.

Can I use a CTE or subquery in an ADF Mapping Data Flow source?

CTEs and FROM-clause subqueries are not supported in data flow source queries — ADF requires a simple SELECT. Encapsulate CTE logic in a database view and reference the view in the ADF source.

A pipeline parameter is used in the query — could that cause IncorrectQuery?

Yes — characters that break SQL syntax (single quotes, backslashes, newlines) make the interpolated query malformed. Use debug mode with 'Override parameters' to inspect the resolved query. For date parameters, use the exact format expected (e.g., 'yyyy-MM-dd').

Will downstream Power BI datasets be affected?

Yes — the data flow fails without reading any source data. Dependent datasets and reports serve stale figures until the query is corrected.

Official documentation: https://learn.microsoft.com/en-us/azure/data-factory/data-flow-troubleshoot-guide

Other data flow errors