• Facebook - Black Circle
  • Twitter Round
  • Instagram Black Round
  • LinkedIn - Black Circle

January 9, 2018

Sometimes for testing purposes (or an emergency) one might find it useful to remove query plan for a single stored procedure. This way you won't have to disrupt the entire instance (and possibly anger your fellow developers!).

I often forget that DBCC FREEPROCCACHE acce...

December 19, 2017

I know, it sounds like it could be a desert. But it's poison! 

You ever have one of those Saturday morning emergencies and come face to face with a wait type that you're completely unfamiliar with? 

I  recently got contacted that a highly transactional SQL Server was per...

November 7, 2017

This post is meant to be a quick primer on Table Partitioning in SQL Server. 

What is it?

Let's say you have a large table that is accepting a lot of transactions, partitioning allows you to scale this particular table out into different (physical partitions). Thus sprea...

November 1, 2017

Before we begin:

While the gui/wizard for setting up Availability groups is super easy, I'm going to go through utilizing T-SQL. This gives us an "Under the hood" look at the way these are setup. I will provide the full script at the end of the post.

As an FYI, I will be...

October 27, 2017

 Build the cluster right so you don't run around frantically like this guy does for a living.

So most DBA's know that AlwaysOn Availability groups were introduced in SQL 2012.  I know it was the most exciting feature for me a few years ago and I couldn't wait to impleme...

October 25, 2017

An elegant function for a more civilized age:

Another way to detect deadlocks is to utilize the TRY CATCH block to raise errors in TSQL code. I found this to be a very elegant way of detecting deadlocks pragmatically. You can use the below code sample in a stored proced...

October 9, 2017

What is it?

A trigger is almost like a command/function that executes automatically in response to another transaction that has executed. Think of it as kind of a stored procedure that executes automatically when an event occurs. 

Types:

DML Triggers - After and Instead

AF...

September 7, 2017

 You might be turning the gun on yourself if you ever have to implement this.

Disclaimer: I would never suggest running this in a production environment without good reason. I was asked to come up with something that will automatically kill blocked processes until the...

June 21, 2017

 Not always optimal...

What is it?

Let’s say you have a parameterized proc, and it creates and caches an execution plan based on certain values for said parameters. It “sniffs” the parameters and uses that for cardinality estimation.

Then you run this stored proc again, b...

Please reload

Please reload

RECENT POSTS: 

FOLLOW ME:

WHO AM I ?

My name is Aamir Syed and I run SQLEvo. I optimize the speed, efficiency, and stability of SQL Server.  When not working I like to lift weights, play music, and travel with my wife.

  • Facebook - Black Circle
  • Twitter - Black Circle
  • Instagram - Black Circle
  • LinkedIn - Black Circle