T-SQL 101: #16 Ordering the output of a T-SQL query

added by DotNetKicks
5/17/2019 2:11:29 PM

1 Kicks, 191 Views

When you run a query against SQL Server, you might want the rows to be returned in a specific order. However, the first thing you should ask yourself is whether that's needed at all. Sorting can be a very expensive operation if there is no suitable index that's already sorted the data for you.