SQL to Excel Ingestion Architectures
When sourcing analytical models from Microsoft SQL Server into Microsoft Excel, there are four standard ingestion architectures. Choosing the right pattern determines pipeline resilience, query folding, and maintenance overhead.
1. Architectural Patterns
TEXT
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Pattern A: Direct Table Ingestion β
β SQL Table βββΊ Power Query βββΊ Excel Table β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Pattern B: Native SQL Query Ingestion β
β SQL Tables βββΊ Custom SQL Statement βββΊ Power Query βββΊ Excel β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Pattern C: SQL View Ingestion (Recommended Enterprise Pattern) β
β SQL Tables βββΊ Stored View (vw_Sales) βββΊ Power Query βββΊ Excel β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Pattern D: Dimensional Semantic Model (High-End BI) β
β SQL DW βββΊ Views/Tables βββΊ Power Query βββΊ Power Pivot βββΊ Dashboard β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
2. Ingestion Pattern Trade-off Matrix
| Criterion | Pattern A (Direct Table) | Pattern B (Custom SQL) | Pattern C (SQL View) | Pattern D (Semantic Model) |
|---|---|---|---|---|
| Maintainability | Poor (tight coupling) | Medium (hardcoded SQL) | High (centralized) | Highest (governed model) |
| Query Folding | Full | Breaks on outer steps | Full | Full |
| Performance | Sluggish if large tables | High | High | Maximum (VertiPaq) |
| Reusability | None | None | Reusable across tools | Reusable across models |
| Best Used For | Quick exploration | Ad-hoc one-off query | Standard reporting | Enterprise Dashboards |
3. Recommended Best Practice
For production Excel pipelines, use Pattern C or D:
- Encapsulate business logic inside a version-controlled SQL View (
dbo.vw_ExecutiveSalesPipeline). - Point Power Query to the View without entering custom SQL statements, ensuring the M engine retains native query folding.
- Load the data directly into the Data Model (Power Pivot) rather than spilling raw rows onto a worksheet grid.