This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
A lunch thermos retaining one prepared meal for repeated servings

CTE or Temp Table: Choosing Where an Intermediate Result Lives

October 3, 2023
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

A CTE is a name, not a saved result. Build both versions on 20,000 rows, compare the plans, and see why the answer is never always one or the other.

Read More
temptable

SQL SERVER – Performance: Optimizing High Volume OR Conditions through TempTable

October 2, 2023
Pinal Dave
SQL Performance
SQL Operator, SQL Performance, Temp Table

We explore an alternative approach when dealing with high volumes of ‘OR’ conditions in our SQL queries: the use of a TempTable.

Read More
evenodd

SQL SERVER – Steps to Identify with Odd and Even Rows

September 28, 2023
Pinal Dave
SQL Tips and Tricks
SQL TempDB, Temp Table

Sometimes, when working with SQL, you might need to do something special with odd and even rows in your table. This can be a bit tricky.

Read More
A cheese press holding differently sized portions beside equivalent weighed pieces

Unit of Measure Conversions: One Table for Kilograms, Pounds and Boxes

August 23, 2023
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

Adding kilograms, pounds and boxes gives a number that means nothing. Convert each product to one base unit and find the rows that cannot convert.

Read More
A market square water pump pouring into a bucket with a smaller bucket nested inside it, water spilling over.

INSERT EXEC: Capturing a Procedure’s Result Set and Its Limits

November 24, 2022
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Server, SQL Stored Procedure, Temp Table

Capture rows with INSERT EXEC, match result columns, understand nested and multiple-result limits, and choose supported alternatives.

Read More
Gouache painting of three grey wheelbarrows in three furrows beside a wooden crate, and a small vermilion basket at a fourth narrow furrow

Table Variables and Parallelism: Reads Yes, Inserts No

June 7, 2021
Pinal Dave
SQL Performance
Parallel, SQL Scripts, SQL Variable, Temp Table

Table variables and parallelism: reads can run in parallel, inserts cannot. See the plan reason, the 1-row estimate at old levels, and when to use a temp table.

Read More
Gouache painting of a muffin tin holding one seashell in each cup with one vermilion shell

Capture sp_who2 Output Into a Table With INSERT EXEC

December 17, 2020
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Monitoring, SQL Scripts, SQL Server, Temp Table

To capture sp_who2 output, create a table with matching columns and fill it with INSERT EXEC. This post builds the table, captures the session list three times with a time stamp, and shows the two errors that stop the method.

Read More
1 2 3 4 … 10 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com