Script to Update Specific Stats
Produced: 17/09/2015 12:27:00
In my previous post I was stating that we need to be more intelligent with our stats updates rather than hitting a whole table with a sledgehammer and potentially suffering poor performance as a result.

However, wouldn’t it be great to be more proactive about the whole thing…

For example, if we know the tables we’re joining, on which columns, and the values we’re looking for, then we could easily check our stats to see if they need updating, and then if they do, update the specific stat.

Continued...
Only Update Stats You Need
Produced: 12/09/2015 12:22:00
I’ve had a LOT of issues with stats over the years, mostly due to ascending keys, and I’m not the only one. However, the way in which I see people try to deal with these issues is quite interesting.

Obviously, nearly everyone simply updates stats, but it’s how they do this which can be crucial.

The most common method I see to deal with this is a simple “It’s table X, therefore we’ll update stats on table X”.

Okay, this will likely work, but it could be wasting a lot of time that you might not be able to afford.

Continued...
Setting Trigger Order
Produced: 07/09/2015 12:19:00
This is something that comes up rarely, but when it does it can be a real pain.

I’ve seen situations in which you have multiple triggers on the same table and these Triggers could also be set to fire from the same action.

This can cause a lot of issues.

What happens if you want these Triggers to fire in a specific order? It might well be the case that if they fire in the wrong order then data could end up being incorrectly processed.

Continued...
How Inserted and Deleted Tables Work
Produced: 02/09/2015 12:16:00
This is another post about Triggers, but in this one we’re going to focus more on the Inserted and Deleted tables that a Trigger has access to.

This will explain how they’re created and therefore how Triggers can cause unexpected issues when reading Execution Plans.

There are differences between the two types of Trigger when it comes to how these internal tables work. One being a lot more obvious than the other.

Continued...
SQL Server Trigger Examples
Produced: 28/08/2015 12:15:00
As mentioned in my previous post, we have 2 types of Trigger available in SQL Server… AFTER and INSTEAD OF.

In this post I’m going to go through a few examples to show syntax and a couple of uses.

These examples will cover both types and also reference both the Inserted and Deleted tables that Triggers offer.

Continued...
1 of 43