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
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
Table Variable Stored

Where are Table Variables Stored? – SQL in Sixty Seconds #095

August 6, 2020
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL Memory, SQL Performance, SQL Scripts, SQL Server, SQL Variable, Temp Table

A very popular question we will answer today Where are Table Variables Stored? Recently I have posted a few videos on my YouTube Channel,

Read More
Gouache painting of a heap of pears beside a grey wooden crate, a blue crate and an open vermilion crate

SELECT INTO Table Variable: Why It Fails and What to Use

March 2, 2020
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Table Operation, SQL Variable, Temp Table

SELECT INTO table variable fails with Msg 102 because SELECT INTO creates its target table and a table variable must be declared first. This post shows two working fixes, a declared table variable and a temp table. It also compares them on rollback, dynamic SQL and row estimates.

Read More
Illustrated cover: Table Variable vs Temp Table

SQL SERVER – Table Variables or Temp Tables – Performance Comparison – SELECT

September 23, 2019
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL TempDB, SQL Variable, Temp Table

Today we are going to discuss the performance comparison of table variables and temp tables when we are running SELECT queries.

Read More
Illustrated cover: #Temp

SQL SERVER – Table Variable or Temp Table – Performance Comparison – INSERT

September 21, 2019
Pinal Dave
SQL Performance
SQL Scripts, SQL Server, SQL Variable, Temp Table

In this blog post, we will talk about Performance Comparison between Table Variable or Temp Table. Comprehensive Database Performance Health Check

Read More
Gouache painting of a slate blue jug on a small wooden pouring stand pouring glaze into a vermilion jar

Dynamic SQL Result Into a Variable with sp_executesql

November 20, 2018
Pinal Dave
SQL Tips and Tricks
Dynamic SQL, SQL Scripts, SQL Stored Procedure, SQL Variable

To get a dynamic SQL result into a variable, use sp_executesql with an OUTPUT parameter. This post tests the pattern on a small demo, explains Msg 214 and shows counts, JSON, new identity values and generic table names. It also covers INSERT with EXEC for result sets.

Read More
Six evenly spaced bird feeders on a fence, a flock of sparrows crowding one and a robin alone on another

Local Variable Estimates: Why the Density Vector Wins

June 18, 2018
Pinal Dave
SQL Performance
Execution Plan, Parameter Sniffing, SQL Server, SQL Statistics, SQL Variable

Understand local variable estimates with skewed data, density calculations, parameter comparisons, and targeted OPTION RECOMPILE tests.

Read More
1 2 3 Next
  • Books
  • Testimonials
  • Privacy Policy

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