Sql Studio 2014 〈2K〉
The graphical plan appeared: a thick arrow from a Clustered Index Scan, a Hash Match spilling to tempdb, and the dreaded yellow warning triangle: "Missing Join Predicate."
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. sql studio 2014
SET STATISTICS TIME, IO ON; EXEC Dashboard.GetMonthlyReport @Year = 2024; Output: Table 'FactSales'. Scan count 1, logical reads 342, physical reads 0 SQL Server Execution Times: CPU time = 312 ms, elapsed time = 407 ms. The graphical plan appeared: a thick arrow from
SELECT CustomerID, Quarter, Revenue FROM Sales.FactQuarters UNPIVOT (Revenue FOR Quarter IN ([Q1_2014],[Q2_2014],[Q3_2014],[Q4_2014],...,[Q4_2024])) AS unpvt; The little red squiggly line appeared under UNPIVOT . SSMS 2014’s parser didn't highlight syntax errors in real-time – but the did something worse when I pressed F5 : Msg 102, Level 15, State 1, Line 5 Incorrect syntax near 'UNPIVOT'. I laughed. Of course. SQL Server 2014 supports UNPIVOT, but someone had changed the database compatibility level to 90 (SQL Server 2005). A trap. Same indexes
The dashboard query that had been timing out (45 seconds) dropped to . I sat back. The blue SSMS window – with its old-school toolbar icons and gray background – felt less like an IDE and more like a cockpit.