Black Friday prices end in 5d 20h 13m — See the sale

Author: Kendra Little

My goal is for you to understand your SQL Server’s behavior– and learn how to change it. When I’m not figuring out the solutions to your database problems, you’ll find me at user group meetings in Portland, Oregon. I also love to draw.

Upgrading to SQL Server 2014: Frequently Asked Questions

Can I upgrade an existing instance without migrating?

This is nothing against SQL Server 2014, but I can't stand in-place upgrades. Over the years I've had in-place upgrades work flawlessly on a few instances, and then had an install issue cause it to fail in the middle on other instances. Usually the critical instances, just because I'm not always lucky. And when upgrade fails, it doesn't always roll back completely, or allow you to just re-run it. You may be down for a good long time.

Read more about Upgrading to SQL Server 2014: Frequently Asked Questions 36 comments — Join the discussion

Extended Events Sessions: Messing Up Filters

Recently, I wanted to play around with the auto_stats event against a test system running SQL Server 2014. I ran through the session setup GUI and added the auto_stats event. I configured it with a filter (predicate) to only show me auto_stats event in a database named AutoStatsTest. There's a cost to events that may fire frequently and a cost to filters, but this is my test box and I was just using this to learn-- so no biggie, right?

Read more about Extended Events Sessions: Messing Up Filters 8 comments — Join the discussion
Performance Tuning

Using “OR” and “IN” with SQL Server’s Filtered Indexes

You can't do everything with filtered indexes in SQL Server. For instance, you can't create the following index:
[crayon-6b0659be40b49091662135/]
If you try, you'll get the error message:
[crayon-6b0659be40b5c804481181/]
Instead, you can use 'IN' and create the index this way:
[crayon-6b0659be40b5f003514947/]
That works-- and good news, even queries written with 'OR' can use that filtered index, because SQL Server is clever like that. Here's an execution plan that shows it in action.

Read more about Using “OR” and “IN” with SQL Server’s Filtered Indexes 4 comments — Join the discussion

Dropping an Offline Database in SQL Server

When you drop a database in SQL Server, the files are normally removed from the file system right away. POOF! Hope you had a backup if you ran DROP DATABASE against the wrong instance.

However, things are a little different if you take the database offline before you drop it. Consider the following code:
[crayon-6b0659be41408267804890/]
Here's what S:\MSSQL\Data looks like after I run the whole script, including DROP DATABASE...

Read more about Dropping an Offline Database in SQL Server 23 comments — Join the discussion
News & Opinion

The Hard Truth About Patching SQL Server Availability Groups (Hotfixes, Cumulative Updates, and Service Packs)

As a DBA, you're responsible for identifying necessary updates to keep your SQL Servers healthy. Your business may have some mandates about the frequency of patches, but even if they don't, you have a duty to look out for Cumulative Updates, Service Packs, and out of band hotfixes that can prevent downtime and prevent performance problems. It's your task to test and apply them as needed.

Read more about The Hard Truth About Patching SQL Server Availability Groups (Hotfixes, Cumulative Updates, and Service Packs) 51 comments — Join the discussion

Reporting From a Log Shipping Secondary in STANDBY mode

I'm a fan of SQL Server's transaction log shipping. It works in Standard Edition, it's relatively simple to set up, and you can even make your log shipping secondary readable using STANDBY mode.

I've worked with some pretty cool, complex log shipping environments over the years. In one case, we had multiple log shipping secondaries and a load balancer involved to support a full fledged reporting application. It worked pretty well-- with a lot of careful scripting and support.

Read more about Reporting From a Log Shipping Secondary in STANDBY mode 65 comments — Join the discussion

How to Use SQL Server’s Dedicated Admin Connection (DAC) – Video

You may have heard that there's a secret back door into your SQL Server-- but have you enabled access to it properly? Do you know when you might need to use it, and how you can connect? Kendra Little explains why the Dedicated Admin Connection (or "DAC") is so important and how to configure remote access.

Read more about How to Use SQL Server’s Dedicated Admin Connection (DAC) – Video 11 comments — Join the discussion
Performance Tuning

Testing ALTER INDEX REBUILD with WAIT_AT_LOW_PRIORITY in SQL Server 2014

One of the blocking scenarios I find most interesting is related to online index rebuilds. Index rebuilds are only mostly online. In order to complete they need a very high level of lock: a schema modification lock (SCH-M).

Here's one way this can become a big problem:

Read more about Testing ALTER INDEX REBUILD with WAIT_AT_LOW_PRIORITY in SQL Server 2014 14 comments — Join the discussion

Does Updating Statistics Cause a Recompile if No Data Has Changed?

tl;dr -- Not necessarily.

One of our students asked me a great question: if you update statistics on every table in the database, is that effectively the same as dumping the procedure cache on the instance? Will every execution plan have to be recompiled the next time it is run? I thought it was a great question and it spurred an interesting discussion about maintenance and recompilation.

Read more about Does Updating Statistics Cause a Recompile if No Data Has Changed? 4 comments — Join the discussion

Tip for Learning Extended Events – Use “New Session” (Not “New Session Wizard”)

Extended Events have become one of my favorite tools for learning about tuning SQL Server. Whenever I wonder how something works, I can fire up a test instance and play around with XEvents. It's always interesting, and at least 5% of the time I end up learning what I intended. Not everything is sunshine and rainbows. Finding…

Read more about Tip for Learning Extended Events – Use “New Session” (Not “New Session Wizard”) 1 comment — Join the discussion

What is the PREEMPTIVE_DEBUG Wait in SQL Server?

Recently we got an email asking for help from a DBA who was concerned about a high percentage of the PREEMPTIVE_DEBUG wait on a SQL Server. They were investigating poor performance and had searched the internet high and low and not found information on what this wait means. They were stumped. What to Do When You Find an Unusual…

Read more about What is the PREEMPTIVE_DEBUG Wait in SQL Server? 2 comments — Join the discussion
Performance Tuning

Read Committed Snapshot Isolation: Writers Block Writers (RCSI)

When learning how Read Committed Snapshot Isolation works in SQL Server, it can be a little tricky to understand how writes behave. The basic way I remember this is "Readers don't block writers, writers don't block readers, but writers still block writers." But that's not so easy to understand. Let's take a look at a simple test…

Read more about Read Committed Snapshot Isolation: Writers Block Writers (RCSI) 20 comments — Join the discussion