Use DELETE TOP safely through an ordered CTE, preview oldest rows, apply a supporting index, and remove eligible rows in bounded batches.
TOP N Sort: Why a Small TOP Still Reads the Whole Table
Explain TOP N Sort, compare an indexed ordered access path, and align filter and sort keys before adding indexes for frequent requests.
SQL SERVER – Distinct and ORDER BY
I have made note that ORDER BY is not required when DISTINCT is used. Let us understand the same subject in detail. Let us learn today.
SQL SERVER – How to Order By a Parameter?
We figured out that there was a very poor code written in one of the Stored Procedure’s Order By clause. Let us learn today how to order by a parameter.
SQL SERVER – Group By Orders Data by Columns Ascending
The question was about Group By Orders Data by Columns Ascending. DBA asked me an interesting question referring to my older blog.
How to Sort a Varchar Column Storing Integers with Order By? – Interview Question of the Week #206
How do you sort a Varchar column storing integers with Order By when you cannot change the datatype? Here are two simple solutions I shared with a developer.
SQL Server – Formatted Date and Alias Name in ORDER BY Clause
Format a date with CONVERT, then use its alias in ORDER BY, and the rows come back in a different order. Here is a simple example of this formatted date surprise.






