SQL blogcasts
  • Performance
  • Development
  • Administration
New
Development & Integration
03/12/2026

Dynamic PIVOT in SQL Server Without Hard-Coded Columns

PIVOT needs its column list in the query. A dynamic PIVOT builds that list from the data with STRING_AGG and QUOTENAME and runs it via sp_executesql.

SQL blogcasts

Practical SQL Server notes and troubleshooting for DBAs and developers.

© 2026 SQL blogcasts

Topics

  • Administration & Monitoring
  • Development & Integration
  • Performance & Internals

Latest notes

  • Dynamic PIVOT in SQL Server Without Hard-Coded Columns
  • Shrinking a Log Without Breaking Log Shipping
  • SQL Server Toolset Overview: Diagnostic Tools to Keep
  • SQL Server 2008 New Tools: SSMS and Their Equivalents

About

  • About the editors
  • Privacy policy
  • Terms of use