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.
Table Variables and Transactions in SQL Server: SQL in Sixty Seconds #007
Table variables and transactions do not mix the way temporary tables do, because a ROLLBACK leaves the rows in a table variable. The tests here cover a full rollback, a savepoint, a failed statement and a logging pattern, all on SQL Server 2025.
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.







