Clean up your campsite! (Refactoring Monolith Database Stored Procedures)

THAT Conference 2017
Day: Tue, Aug 8   Time: 10:30 AM   Location: Tamarind (map)
Level: 200  Primary Category: Data/Storage  Secondary Category: 
Tags: testing, SQL Server, SQL, Stored Procedures
Your campsite is a mess. There are "totally safe to burn" plastic wrappers melted in last night's ashes. The roasting sticks are coated with dirt-encrusted marshmallow goo. And some sort of animal went through the trash bag you left out. (Oops.)

We get it. Move fast and break things. Just ship it! But what's left a giant stored procedure with cursors, temp tables, and mystery calculations. It's a big black box that nobody wants to touch. Let's fix that. We'll open the lid on an example monolith and do major surgery. What's left will perform better, be easier to understand, encourage code reuse, and be easier to test.

You might even begin to like writing SQL.

(This talk is geared to developers using Microsoft SQL Server, but many of its principles apply to any RDBMS.)