One question I always ask all of my customers before I start Comprehensive Database Performance Health Check is that if they have taken backup of their server. The answer to this question honestly does not matter to me during consultancy I never change anything which brings to the situation where they need to restore the database. However, when I asked this question to my client, they said they have an issue to identify a version of SQL Server from the backup file.
SQL SERVER – Creating Temporary and Global Temporary Stored Procedures
During recent Comprehensive Database Performance Health Check, I had a very interesting situation I encountered where we found a stored procedure which was a root cause of the slowness. What we needed to do is to change the code and test if our new stored procedure is better than previous stored procedure or not. One of the options was to create a new stored procedure by renaming the older stored procedure and keep on testing. However, there was a small risk if we forget to drop the newly created stored procedure there will be junk created in the database. Let us see how we can avoid this situation by creating temporary or global Temporary stored procedures.
SQL SERVER – Puzzle – How Does YEAR Function Work?
There are many different datetime related functions such as DAY, MONTH, YEAR, DATEDIFF, etc available in SQL Server. For example, YEAR function can be used to extract year value from a date.
What is Alternative to CASE Statement in SQL Server? – IIF Function – Interview Question of the Week #164
Question: What is Alternative to CASE Statement in SQL Server?






