There is a very common anti-pattern you should avoid, involving updating a row if it exists and inserting it if it doesn't. See how to avoid race conditions and deadlocks.
Aaron Bertrand
Altering a fixed-width column on a large table can often mean either a lot of planning or a lot of downtime, but in some scenarios there may be an easy out.
We had a case where we increased a varchar column's size, ONLINE, but it caused significant downstream effects. See why.
There are some limitations with STRING_SPLIT that could be overcome, but the cleanest solution might be to add a new function altogether.
My daughter surprised me with a question about work last week, and I answered her by invoking Taylor Swift.
Find out about the replacement I wrote for the undocumented, unsupported, and ill-advised system procedure, sp_MSforeachdb.
A quick update on some maintenance I performed on the site over the weekend.
Updated in 2020 with a few new entries, this is a fairly comprehensive list of the reasons behind various 18456 error messages.
For this month's T-SQL Tuesday, Kerry Tyler asks us to talk about something that went wrong. I had plenty to choose from, and went way back to ~2002 for this short story.
See two ways you can make the relevant data in the system_health session last longer and not get drowned out by noise.
For this month's T-SQL Tuesday, let's talk about something you're more likely to hear from a carpenter: Measure twice, cut once.
See how to work around some of the blockers for replacing legacy UDFs with STRING_SPLIT.
Access the system_health file target without tedious string parsing gymnastics.
This series shows how I determine the amount of data distributed across indexes, files, filegroups, and partitions.
Dig into an intermittent stack dump involving an aggregate query against a heap with a LOB column.
Discover some undocumented or unsupported behavior you might not even realize you're relying on.
See a quick T-SQL script for determining how often Cinco de Mayo falls on Taco Tuesday.
I continue a series where I dig into how data is distributed across indexes, files, and filegroups.
I talk about a recent change where I started turning on indirect checkpoints across all user databases.
I finish up my series on replacing the default trace with views to simplify consumption and a caveat about reports in SSMS.
See the stored procedure I wrote to help me put all file, filegroup, and index information in one place.
I continue my series on replacing the default trace with a more efficient and more complete Extended Events session.
See how blogging can benefit both the author and the reader in this short opinion piece.
Phase 3 of my home office – doors! – couldn't have happened at a better time.
I want to push for improvements to STRING_SPLIT in the next version of SQL Server. See how you can help!
See a quick example where plan shape can cause errors that really shouldn't happen.
In this tip, see ways you can change how a function is called without having to modify all calling code at the same time.
Need to get data, log, or bak files into your container's file system? See how, with docker cp
.
With the increasing number of office closures, I share some tips about working from home.
In this tip, I show how to measure the positive effects of delayed durability, in cases where a small amount of data loss is acceptable.
I start a series explaining how I evaluated the default trace and decided to replace it with a slimmer Extended Events session across all of production.
See how you can use Extended Events to find your worst performing checkpoints.
This month, Jess Pomfret hosts T-SQL Tuesday, and asks us to talk about our own personal life hacks that make our day easier.
In this tip, I talk about a concerning behavior in a dynamic management function.
I continue my series on large table compression with results from row and page compression as well as a process involving scheduler manipulation.
In this tip, I show how soft deletes and a filtered index can help minimize the cost of ghost records in an Availability Group.
I detail my home office setup, much of the gear in it, and show the progress of a minor renovation – a new standing desk and improved backlighting.
For this month's T-SQL Tuesday, I talk a little bit about how I make my imposter syndrome feel less like imposter syndrome.
I continue my series on investigating compression for a 1TB table, honing in on clustered columnstore and partitioning.
In this tip, I show how and why a columnstore index can provide benefits to COUNT(*) queries.
With another new year comes the recognition of a standout contributor to the SQL Server community. Read on to see 2019's honoree.
I start a series looking at using clustered columnstore indexes and page compression to address storage footprint for a 1TB table.
I show how I tried to chase down a very unexpected issue with SQL Server metadata. Spoiler: it didn't end the way I thought it would.
For this month's T-SQL Tuesday, I talk about an opportunity earlier this year to significantly change my career trajectory.
Discover a simple way to keep your filtered indexes effective – even under forced parameterization.
Conventional wisdom has suggested that deletes should be batched, but in some cases this can actually take a lot longer.