Object names in SQL Server can be up to 128 characters, but local temp tables stop at 116. Guest author Balmukund Lakhani explains this limit for Temp Objects.
CTE Referenced Twice: Why the Query Runs It Twice
Writing a CTE name two times can mean doing the work two times. Two small demos show when a temp table helps and when it only adds cost.
Triangular Joins: The Hidden Row Explosion in Self-Joins
A small grouped result can hide a huge pile of row pairs. Here is how to count them and what to do instead.
Replacing a Running Total Cursor With a Window Function
That loop adding to a variable can usually become one window function. Here is the proof that the balances match, and the tie trap to watch for.
Numbers Table vs GENERATE_SERIES: Building Rows on Demand
Learn numbers table in SQL Server with practical examples, clear checks, common traps, and guidance for your own database.
Table Variables vs Temporary Tables Quiz: Which Survives a Rollback?
This Table Variables vs Temporary Tables Quiz inserts one row into each, then rolls back. The table variable keeps its row and the temporary table loses it. A tested script proves it, and two more scripts show a rollback-proof log and the statistics gap.
Temp Table Caching: Why Some Temp Tables Get Reused
Understand temp table caching in stored procedures, avoid cache blockers, inspect creation counters, and review retained statistics.







