SQL SERVER – New Way to Use DBCC Page in SQL Server 2019

As soon as a new version of SQL Server is announced, I always try to find new things and update my old post with new information or write a new post. In this blog, we would learn about new function introduced in SQL Server 2019 which is a partial replacement of DBCC PAGE.
If you have not heard about the capability of DBCC PAGE then you can look at my earlier blog on the same topic. SQL SERVER – Identifying Page Types

Read More

SQL Server – Formatted Date and Alias Name in ORDER BY Clause

CONVERT function can be used to change the format of DATE to various formats like MM/dd/yyy, dd/MM/yyy, yyy/MM/dd, etc. But have you ever noticed that this will produce resultset with a different order if the alias name is used in ORDER BY Clause? Well, I just learned about the formatted date from my recent consulting engagement Comprehensive Database Performance Health Check.

Read More

SQL SERVER – Selecting Random n Rows from a Table

Every day I spend a good amount of time with different customers helping them with SQL Server Performance Tuning issues. Today we will discuss the question asked by a developer at the organization where I was engaged in Comprehensive Database Performance Health Check. The developers wanted to know if there is any way he can randomly select n rows from a table.

Read More