Tag
#data-fix
2 patterns, 7 snippets and 2 tools.
- Pattern Changing Large Volumes of Production Data Without an Outage Planning backfills and clean-ups that touch millions of rows while the system stays live.
- Tool List to SQL Converter Turn a pasted list of ids, or ids and new values, into a #temp table, an IN list, or JSON for OPENJSON.
- Tool Reversible Data Fix Script Builder Generate a SQL Server data fix script for an update or a delete, with a preview, backup table, verification, and a ready-made rollback or restore.
- Snippet SQL Server: Find and Remove Duplicate Rows with ROW_NUMBER() Preview duplicate rows, keep one per group, and delete the rest safely.
- Snippet SQL Server: Record Changed Rows with OUTPUT INTO Capture before and after values of an UPDATE or DELETE in the same statement, so any data fix can be undone.
- Snippet SQL Server: Update or Delete Millions of Rows in Batches Change large volumes of data in small batches to avoid table locks, log growth and blocking.
- Snippet SQL Server: Safe Bulk DELETE Using JOIN Delete rows using a JOIN with a preview step to avoid accidental data loss.
- Snippet SQL Server: Update Only When Values Change Avoid unnecessary writes and locking by updating rows only when values differ.
- Snippet SQL Server: UPSERT Without MERGE Insert new rows and update existing rows safely without using MERGE.
- Snippet SQL Server: Bulk Update with JOIN Update many rows from a supplied list of IDs + values using a temp table and JOIN. Ideal for data fixes.
- Pattern Designing a Reversible Data Fix in SQL Server A repeatable approach for production-safe updates with verification and rollback.