How to create date buckets in T-SQL

October 28, 2019 Andy 0

I was fiddling around with some data, looking at making a quick aging report. I probably should have reached for Power BI Desktop, but sometimes I can be stubborn, and I wanted to get my T-SQL to work–if nothing else to figure out how to … [Read More]

How does a database RESTORE affect plan cache?

October 24, 2019 Andy 0

If you restore a database, what does that do to the plan cache? Well, let’s start by looking at the documentation for RESTORE. (Emphasis mine) Restoring a database clears the plan cache for the instance of SQL Server. Clearing the plan cache causes a recompilation … [Read More]

What the heck is Accelerated Database Recovery?

October 21, 2019 Andy 2

Last week, I wrote about the SQL Server Version Store. The week before, I looked at crash recovery. Let’s look next at a new feature in SQL Server 2019, where these two features intersect: Accelerated Database Recovery. What is it? Accelerated Database Recovery(ADR) is a … [Read More]

What the heck is the SQL Server Version Store?

October 15, 2019 Andy 1

Maybe you’ve read about the Read Committed Snapshot (RCSI) or Snapshot Isolation levels. Or maybe you were trying to figure out the difference between the two snapshot isolation levels. Perhaps you’ve looked into read-only secondary replicas in your Availability Group, or even had some problems … [Read More]

Updates to the Data Blogger Resource Kit

October 9, 2019 Andy 2

Earlier this year, I published the first crack at a Data Blogger Resource Kit. When I initially created the kit, I wasn’t quite sure exactly what direction I would go with it. In the months since, I’ve started to get a better idea of where … [Read More]

Supporting the LGBTQ #SQLFamily

September 23, 2019 Andy 0

I won’t be at PASS Summit this year, so unlike last year, I won’t be organizing an LGBTQ Meetup at PASS Summit. I’m hoping that even without the meetup, all my LGBTQ #SQLFamily friends will still get together for some fun and networking. Keep scrolling … [Read More]

When to put a non-clustered index on your clustering key

September 3, 2019 Andy 1

There is a corner case where it makes sense to have a non-clustered index “duplicating” the clustered index. If you have a query that frequently scans the table, and ONLY makes use of the clustering key column, the query optimizer will prefer to use the non-clustered index.

Why does ALTER let me DROP?

August 28, 2019 Andy 3

I was recently chatting with a coworker, discussing why there is no discrete DROP permission for tables, procedures, etc. The conversation actually came from a #SQLHelp question on SQL Slack that was asked along the lines of “What if I want to let a user … [Read More]