Alphonsus Swedish School is part of the Alphonsus Library Dismiss
The Night the Database Spoke
I wrote a query to unpivot a decade of quarterly sales: sql studio 2014
But the server hummed a little quieter that day. And somewhere in the logs, a 2014 query plan smiled. Tools age, but fundamentals don't. Execution plans, indexing, statistics, and parameter sniffing – SSMS 2014 forced you to know them. And knowing them still saves the day. The Night the Database Spoke I wrote a
But I had the right tool: (yes, the official Microsoft SQL Server Management Studio for the 2014 version). Clunky by today’s standards. No dark mode. IntelliSense that sometimes forgot it was intelligent. But reliable. Like an old truck. Clunky by today’s standards
Suddenly, the query ran again – 40 seconds. What? I checked the execution plan. Same indexes. Then I remembered: parameter sniffing. SQL Server 2014 didn't have the automatic plan forcing of later versions. I added OPTION (RECOMPILE) to the stored procedure and added WITH RECOMPILE to a frequently called function.
CREATE NONCLUSTERED INDEX IX_FactSales_OrderDate_Include ON Sales.FactSales (OrderDate) INCLUDE (CustomerID, ProductID, Revenue);
No products in the cart.