Intermediate

T-SQL Programming

Go beyond basic queries and master the art of programming with Transact-SQL. Build stored procedures, functions, triggers, and dynamic SQL solutions for real-world applications.

🕒 10 Hours 📜 56 Lessons ★ 4.8/5 (980 reviews) 🎓 Certificate
$49
One-time payment • Lifetime access
  • 10 hours of video content
  • 56 hands-on lessons
  • Complete source code library
  • Real-world project examples
  • Certificate of completion
  • Priority Q&A access
Enroll Now

30-day money-back guarantee

What You Will Learn

  • Write efficient stored procedures with parameters
  • Create scalar and table-valued functions
  • Implement DML and DDL triggers
  • Master CTEs and recursive queries
  • Use window functions (ROW_NUMBER, RANK, LAG, LEAD)
  • Handle errors with TRY...CATCH blocks
  • Build dynamic SQL safely to prevent injection
  • Work with temporary tables and table variables
  • Implement cursors and understand when to avoid them
  • Optimize T-SQL code for performance

Course Curriculum

Module 1: Advanced Query Techniques 7 lessons
  • Common table expressions (CTEs)
  • Recursive CTEs for hierarchical data
  • Window functions overview
  • ROW_NUMBER, RANK, DENSE_RANK
  • LAG, LEAD, FIRST_VALUE, LAST_VALUE
  • Running totals and moving averages
  • Lab: Building a ranking and analytics report
Module 2: Stored Procedures 8 lessons
  • Creating your first stored procedure
  • Input and output parameters
  • Return values and result sets
  • Control flow (IF, WHILE, CASE)
  • Nesting and calling procedures
  • Procedure best practices
  • Debugging stored procedures in SSMS
  • Lab: Order processing system
Module 3: Functions 6 lessons
  • Scalar functions
  • Inline table-valued functions
  • Multi-statement table-valued functions
  • Functions vs stored procedures
  • Performance considerations for functions
  • Lab: Building a reusable function library
Module 4: Triggers 5 lessons
  • DML triggers (AFTER, INSTEAD OF)
  • Accessing inserted and deleted pseudo-tables
  • DDL triggers for schema changes
  • Trigger pitfalls and best practices
  • Lab: Building an audit trail system
Module 5: Error Handling & Transactions 6 lessons
  • TRY...CATCH structure
  • ERROR_NUMBER, ERROR_MESSAGE, ERROR_SEVERITY
  • THROW vs RAISERROR
  • Transaction management patterns
  • Savepoints and nested transactions
  • Lab: Robust error handling framework
Module 6: Dynamic SQL & Advanced Topics 6 lessons
  • Building dynamic SQL with sp_executesql
  • Preventing SQL injection attacks
  • Temporary tables vs table variables vs CTEs
  • MERGE statement for upserts
  • Working with JSON and XML data
  • Final project: Complete application data layer

Your Instructor

LP

Laura Petersen

Senior T-SQL Instructor

Laura is a seasoned SQL Server developer with 15 years of experience building data-driven applications. She has authored two books on T-SQL programming and regularly speaks at SQL Server conferences. Her courses emphasize clean, maintainable code that performs well at scale.

Prerequisites

Level Up Your T-SQL Skills

Write professional-grade T-SQL code that powers real applications.

Enroll for $49