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.
Execution plans, indexes, the transaction log, SQL Agent jobs and wait stats: tested T-SQL for DBAs and developers, with the version it was run on.
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.
Switching to SIMPLE recovery stops log shipping. Find what blocks log truncation before you shrink the log file on the primary.
Which diagnostic tools should you keep in SQL Server? A practical order: wait stats, blocking, execution plans, Query Store and Extended Events.
The SQL Server 2008 tools that changed SSMS: Activity Monitor, IntelliSense and Data Collector, with today's replacements and how to verify.
SQL Server's TIME data type stores time of day from 00:00:00.0000000 to 23:59:59.9999999 with scale 0-7. Range, byte sizes and T-SQL examples.
Scalar UDFs can force a serial plan and ignore MAXDOP. Learn to read the plan node, benchmark the rewrite to inline or TVF, and check compatibility level.
Count word occurrences in SQL Server full-text columns using sys.dm_fts_index_keywords_by_document. Includes a query, worked example and performance notes.
Learn how to script data from SSMS: generate INSERTs for one table or a whole database, choose Types of data to script, and verify the output.
Why DBA skills matter: what a DBA owns, how wait stats and CHECKDB prevent downtime and corruption, and how to build the skills employers notice.
Sort SQL Server rows by a dynamic column without dynamic SQL using CASE in ORDER BY, with execution plan notes, sargability risks and safer alternatives.