When STRING_SPLIT() falls short

March 20, 2020 Andy 0

This morning, my friend Aaron Bertrand (blog|twitter) posted a plea for help with STRING_SPLIT() improvements. I’m very much in Aaron’s corner on this, having written about the olden days myself. Why STRING_SPLIT() is supposed to be awesome CLR was fast, but inaccessible to many DBAs. … [Read More]

Blocking with OBJECT_NAME()

December 24, 2019 Andy 0

As a DBA, you probably use the OBJECT_NAME() function quite a bit. I know I do. If you aren’t familiar with it, you can read the documentation if you want, but it’s a pretty straightforward function that converts object IDs into object names. I ran … [Read More]

What the heck is the dbcreator role?

December 19, 2019 Andy 0

Microsoft docs defines the dbcreator role as: Members of the dbcreator fixed server role can create, alter, drop, and restore any database. But what specific permissions are actually included in that role? If we scroll down in the docs just a little, we’ll see a … [Read More]

I hate sp_estimate_data_compression_savings

December 17, 2019 Andy 0

If you’re working with compressed indexes, SQL Server provides a system stored procedure to help test the space savings of implementing data compression: sp_estimate_data_compression_savings. Starting in SQL Server 2019, it can even be used to estimate savings with columnstore. I really don’t like sp_estimate_data_compression_savings. In … [Read More]

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]