So You Want To Implement Soft Deletes In SQL Server

Опубликовано: 16 Март 2026
на канале: Erik Darling (Erik Darling Data)
2,481
118

In this video, I delve into the considerations for implementing soft deletes in SQL Server, covering both scenarios where you might want to soft delete something due to a mistake or for archival purposes, and situations where you only need to query the most active row. I highlight the challenges of backfilling columns with data when adding them to existing tables, emphasizing the importance of batching updates to avoid overwhelming your server. Additionally, I discuss alternative approaches such as using temporal tables, offering insights into their limitations and potential issues. The video also covers best practices for creating views and filtered indexes to ensure developers consistently query active or inactive rows without needing to remember specific predicates, making soft delete implementations more robust and user-friendly.

CHAPTERS

00:00:00 - Introduction to Soft Deletes
00:03:45 - Challenges of Implementing Soft Deletes
00:06:17 - When to Use Soft Deletes vs Temporal Tables
00:08:29 - Design Considerations for Soft Deletes
00:11:23 - Implementation Steps for Soft Deletes
00:14:56 - Best Practices and Recommendations
00:17:16 - Conclusion and Q&A

━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 TRAINING & COURSES
━━━━━━━━━━━━━━━━━━━━━━━━━━
Get AI-Ready With Erik
https://training.erikdarling.com/get-...

SQL Server Performance Engineering Course
https://training.erikdarling.com/sql-...

Learn T-SQL with Erik
https://training.erikdarling.com/lear...

Everything Bundle:
https://training.erikdarling.com/?cou...

━━━━━━━━━━━━━━━━━━━━━━━━━━
🛠️ CONSULTING & SERVICES
━━━━━━━━━━━━━━━━━━━━━━━━━━
Need SQL Server performance help?
https://training.erikdarling.com/sqlc...

━━━━━━━━━━━━━━━━━━━━━━━━━━
💬 CONNECT
━━━━━━━━━━━━━━━━━━━━━━━━━━
Ask questions at Office Hours
https://erikdarling.com/officehours/

Become a channel member
   / @erikdarlingdata  
━━━━━━━━━━━━━━━━━━━━━━━━━━