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 baskets of apples and pears with a line of leftover apples, one of them vermilion

EXCEPT Operator in SQL Server: Distinct Rows and Differences

December 26, 2018
Pinal Dave
SQL Tips and Tricks
SQL Distinct, SQL Operator, SQL Scripts, SQL Server

The EXCEPT operator returns the rows of one query that are missing from another, with duplicates removed. This post shows the difference between two small order tables, the old WHERE 1 = 0 trick for distinct rows, and how NULLs behave.

Read More
SQL SERVER - Optimize Key Lookup by Creating Index with Include Columns

SQL SERVER – Optimize Key Lookup by Creating Index with Include Columns

November 17, 2018
Pinal Dave
SQL Tips and Tricks
Execution Plan, SQL Index, SQL Operator, SQL Scripts, SQL Server

A query slowed to over 10 minutes because of a big key lookup. Here is how I optimize key lookup operations by creating an index with include columns.

Read More
Wood shavings are inspected beside the joinery work that produced them.

SQL SERVER- High CPU and Transaction Type WorkFileGroup_fake_worktable and Workfile

August 28, 2018
Pinal Dave
SQL Performance
SQL Error Messages, SQL Operator, SQL Performance, SQL Scripts, SQL Server, SQL TempDB

Workfile and WorkFileGroup_fake_worktable were clues in a customer high-CPU investigation. I correlated them with queries and plan evidence.

Read More
SQL SERVER - Performance Comparison IN vs OR

SQL SERVER – Performance Comparison IN vs OR

June 13, 2018
Pinal Dave
SQL Performance
SQL Function, SQL Operator, SQL Server

Which query runs faster, one with IN or one with OR? Here is my performance comparison IN vs OR on AdventureWorks, and both turn out equal.

Read More
Gouache painting of a brass scale with two dates on one pan and a tall heap of pears with a vermilion pomegranate on the other

Adding Two Dates in SQL Server: Why the Year Is 2126

October 17, 2017
Pinal Dave
SQL Puzzle
SQL DateTime, SQL Operator, SQL Scripts, SQL Server

Adding two dates in SQL Server does not raise an error. It returns a date in the year 2126. This puzzle explains how datetime counts days from 1900, why the plus sign accepts a second date, and what to write instead.

Read More
Two brass strainers with different filtering structures beside cherries

Performance Comparison EXCEPT vs NOT IN – Interview Question of the Week #095

October 30, 2016
Pinal Dave
SQL Interview Questions and Answers
SQL Operator, SQL Scripts, SQL Server

EXCEPT vs NOT IN: which is faster? An attendee at PASS Summit asked me, and my simple example shows they work the same way and perform the same.

Read More
SELECT One by Two - Interview Question Extended - Part II

SELECT One by Two – Interview Question Extended – Part II

April 30, 2016
Pinal Dave
SQL Interview Questions and Answers
SQL Operator, SQL Scripts, SQL Server

After my SELECT One by Two puzzle, I played with a small extension: three queries mixing 1. and 1/2. Can you guess what each one returns and why?

Read More
Previous 1 2 3 4 5 6 7 Next
  • Books
  • Testimonials
  • Privacy Policy

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