All About SQL Server Stored Procedures: Error And Situation Handling

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

In this video, I delve into the intricacies of error handling and situation management within stored procedures, emphasizing their importance in SQL Server environments. Whether you're tuning performance or developing applications, understanding how to handle errors and unexpected situations can significantly improve your database's reliability and efficiency. I also share some practical examples and best practices, such as checking for parameter inconsistencies at the start of a procedure and handling empty result sets by stopping execution early rather than processing unnecessary steps. Additionally, I discuss the use of row count big in triggers, explaining why it's the preferred method over ADAT row count and how to implement it effectively. If you're interested in supporting this channel or learning more about SQL Server performance tuning, there are several ways to get involved-becoming a member, asking questions during my office hours episodes, or even hiring me for consulting services.

CHAPTERS

00:00:00 - Introduction
00:01:21 - Error Handling Importance
00:05:31 - Helpful Links
00:06:00 - Unexpected Situations
00:07:19 - Logging Errors
00:08:45 - Parameter Sniffing Examples
00:10:24 - Parameter Check Implementation
00:13:00 - Critical Processing Issues
00:16:24 - Retry Mechanisms
00:19:18 - Different Retry Strategies
00:20:08 - Data Robustness
00:20:32 - Table Variables Discussion
00:21:25 - Error Handling with Table Variables
00:24:02 - Conclusion

━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 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  
━━━━━━━━━━━━━━━━━━━━━━━━━━