T-SQL Script to find High CPU Queries

There are times when you would want to know what query in SQL Server may be causing CPU spikes. There are many reason why a query may hit the CPU and the best way to troubleshoot it to: Identify the query that is causing high CPU Identify the total time taken by query...

Why do Queries behave differently in production

You may have experienced something similar where the query or a stored procedure performs bad when deployed in the production and the same query / stored procedure works perfectly well in the test or development environment. Behind the scenes (Query Internals) It is...

Improve Performance of SQL Server File Operations

Ever wondered why SQL Server takes long time to perform below operations? Create a database Expand data files for additional growth Automatic data file growth due to auto-grow settings Restoring a database, etc. Today we will be looking in to a powerful and yet not...

Why to Optimize Ad-Hoc Workload in SQL Server

By default, when a query is executed in SQL Server, it compiles and generates an execution plan for that query and stores that plan in the plan cache. Now if this happens to be a one-off/ad-hoc query that will never be run again, then the newly generated plan is...

Automatic database backups in Azure Cloud

Backups are extremely important for the continuity of business. Many companies fire their engineers just because they didn’t have proper backups in place. Wouldn’t it be great if there was a way that DBA’s and engineers didn’t have to...

Hacking SA Password in SQL Server

You are a proud and trusted DBA of your organization who is responsible for maintaining and managing SQL Servers in the production environment. To prevent any unauthorized access to your production environment, you have decided to perform the following steps that are...