analyze_sql_queries
Reviews hand-written SQL in Power BI M queries to flag unsafe writes, row-dropping TOP caps, SELECT *, hard-coded dates, varchar truncation, NOLOCK, UNION issues, and concatenation risks.
Instructions
Review every hand-written SQL statement embedded in the M code ([Query=...], Value.NativeQuery): writes/DROP against real tables in a read query, TOP N caps that silently drop rows, SELECT *, hard-coded years / year-named tables, CAST to varchar without length (truncates at 30), NOLOCK, UNION vs UNION ALL, ORDER BY, temp-table batches, cross- database reads, and SQL built by concatenation. Also lists navigation- style SQL queries (which can fold).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instance | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||