# 323 Dynamic SQL 94831248

> Limitations of Dynamic SQL

- Skill: `tools-only/323-dynamic-sql-94831248` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tools-only/323-dynamic-sql-94831248`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/323-dynamic-sql-94831248/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/tools-only/323-dynamic-sql-94831248

---

# Limitations of Dynamic SQL

## PROBLEM

Some SQL patterns that work in legacy dbt may not be supported by Fusion's static analysis, such as:
```sql
PIVOT(...) FOR column_name IN (ANY)
```

## SOLUTION

The first option is always preferred and should be attempted first, if possible. 

### option 1: refactor

refactor away any instances of `PIVOT(...) FOR column_name IN (ANY)` to have hard-coded values.

### option 2: disable static analysis

For models with unsupported dynamic SQL:
1. Add `static_analysis = 'off'` to the model config:
```sql
{{
    config(
        materialized = 'table',
        meta = {
            'static_analysis': 'off'
        }
    )
}}
```

2. Or disable static analysis globally for the model in `dbt_project.yml`
