Three AdventureWorks examples show how the Query Optimizer picks an index, what happens when you force one, and how that changes the index and execution plan.
Running Start Times: Build an Agenda With SQL
Running start times depend on the durations that precede each activity. Use ordered window sums while retaining full dates and explicit end boundaries.
SQL SERVER – Interesting Observation about Order of Resultset without ORDER BY
Two simple AdventureWorks queries return the same rows in a different order without ORDER BY. I explain why that order is never guaranteed.
SQL SERVER – Simple Use of Cursor to Print All Stored Procedures of Database Including Schema
An improved script to print all stored procedures of database, now with schema names. Jerry Hung’s cursor uses sys.all_objects and sp_HelpText.
SQL SERVER – Simple Use of Cursor to Print All Stored Procedures of Database
A simple cursor with sp_HelpText can print all stored procedures of your database. Switch results to text view with CTRL+T to read them easily.
Baselines: Knowing What Normal Looks Like
Build a SQL Server baseline with timestamped workload, wait, and IO samples so you can compare a slowdown with a similar period of normal work.
SQL SERVER – Delete Backup History – Cleanup Backup History
SQL Server keeps backup history in msdb forever. Use sp_delete_backuphistory to delete backup history older than 30 days, or any number you pick.






