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
- 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.
- 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.
- 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.
- 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.
- 5Enable debug mode and preview the source transformation with a row limit to test the query at runtime.
Frequently asked questions
Official documentation: https://learn.microsoft.com/en-us/azure/data-factory/data-flow-troubleshoot-guide