All About SQL Server Stored Procedures: Cursors vs While Loops
In this video, I dive into the world of cursors within stored procedures, addressing both their necessity and potential pitfalls. Erik Darling from Darling Data shares his insights on when a loop might be more appropriate than a cursor, highlighting common issues like improper termination or complex logic that can lead to performance bottlenecks. He also delves into different cursor options, such as local static and fast forward, explaining how they impact query performance and offering tips for choosing the right option based on your specific use case. By covering these topics, I aim to help viewers make informed decisions about when cursors are truly necessary and how to implement them effectively without falling into common traps. CHAPTERS 00:00:00 - Introduction 00:01:38 - You and Stored Procedures 00:03:36 - Looping with Cursors 00:05:29 - Cursor Options Explained 00:07:47 - Fast Forward Cursor Issues 00:09:00 - While Loops in SQL 00:14:22 - Using Cursors for Data Passing 00:16:46 - Conclusion ━━━━━━━━━━━━━━━━━━━━━━━━━━ 📚 TRAINING & COURSES ━━━━━━━━━━━━━━━━━━━━━━━━━━ Get AI-Ready With Erik https://training.erikdarling.com/get-ai-ready-with-erik?coupon=AIREADY SQL Server Performance Engineering Course https://training.erikdarling.com/sql-server-performance-engineering?coupon=ENGINEERING Learn T-SQL with Erik https://training.erikdarling.com/learn-t-sql-with-erik?coupon=ADVANCEDTSQL Everything Bundle: https://training.erikdarling.com/?coupon=SPRINGCLEANING ━━━━━━━━━━━━━━━━━━━━━━━━━━ 🛠️ CONSULTING & SERVICES ━━━━━━━━━━━━━━━━━━━━━━━━━━ Need SQL Server performance help? https://training.erikdarling.com/sqlconsulting ━━━━━━━━━━━━━━━━━━━━━━━━━━ 💬 CONNECT ━━━━━━━━━━━━━━━━━━━━━━━━━━ Ask questions at Office Hours https://erikdarling.com/officehours/ Become a channel member https://www.youtube.com/@ErikDarlingData/join ━━━━━━━━━━━━━━━━━━━━━━━━━━
Download
0 formatsNo download links available.