SQL Server Tutorial with Examples.
SQL Server tutorial: T-SQL, stored procedures, SSMS, indexing strategies and enterprise database administration on Microsoft SQL Server.
Beginner
Start here — no prior experience needed
Intermediate
For developers with core concepts down
Clustered vs Nonclustered: When an Index Makes a Query Slower
Forcing SQL Server to use a nonclustered index costs 217 logical reads -- worse than the 40-read scan it was supposed to beat -- because every matching row needs a separate key lookup. INCLUDE fixes it at 4 reads.
Window Functions: Ranking Ties, and Why WHERE Can't See Them
RANK() and DENSE_RANK() handle a three-way tie for first place completely differently from each other and from ROW_NUMBER() -- and none of the three can be filtered directly in WHERE, a real Invalid column name error proves it.
Recursive CTEs and the Default MAXRECURSION 100 Limit
A recursive CTE generating a date series past 100 rows fails with Msg 530 by default -- SQL Server caps recursion depth at 100 unless OPTION (MAXRECURSION n) says otherwise.
A Real Dirty Read: Seeing a Value That Never Actually Existed
READ UNCOMMITTED reads an uncommitted price change mid-transaction -- then the transaction rolls back, and the value never really existed. The default READ COMMITTED blocks instead, confirmed with a real timeout.
The Trigger That Silently Dropped a Row
A trigger reading `inserted` into scalar variables works fine for a single-row insert -- and silently audits only one of two rows on a multi-row insert, because a trigger fires once per statement, not once per row.
Advanced
Production-grade patterns for experienced engineers
Also part of SQL Server
Taught in other topics. Each link opens the lesson in its home topic.