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: a row of eight wooden window shutters, alternately open and closed, with a mirror row beneath it where every shutter is the opposite; one shutter is painted vermilion

SQL Puzzle – SELECT ~ 1 : Guess the Answer

April 9, 2021
Pinal Dave
SQL Puzzle
SQL Operator, SQL Scripts, SQL Server

SELECT ~ 1 returns -2 because the tilde is the bitwise NOT operator and flips all 32 bits of an int. This post keeps the puzzle, tests the answer on SQL Server 2025 with five data types and shows where the tilde is useful.

Read More
Five wooden cups on a felt table, four turned up empty and one still covered.

NOT IN With a NULL in the List Returns No Rows

April 8, 2021
Pinal Dave
SQL Tips and Tricks
SQL NULL, SQL Operator, SQL Server, SQL Sub Query

See why NOT IN with a NULL returns no customers, then compare five sample rows, NOT EXISTS, an IS NOT NULL filter, and query plans.

Read More
A hand muffling the clapper of one handbell with a leather pad in a row of brass handbells

USE HINT: Switching Off One Optimizer Rule Without Trace Flags

April 5, 2021
Pinal Dave
SQL Performance
Query Hint, Query Store, SQL Server, TraceFlags

Apply USE HINT to one query, inspect supported names, compare optimizer behavior, and manage Query Store hints with a clear removal plan.

Read More
A farmhouse fireplace just relit in the morning, a small flame catching on kindling under cold logs.

When Did SQL Server Last Restart? Four Ways to Check

April 2, 2021
Pinal Dave
SQL Tips and Tricks
DBA, SQL DMV, SQL Log, SQL Server, SQL TempDB

Find SQL Server’s last restart using startup metadata, tempdb, logs, and sessions, then interpret reset counters correctly.

Read More
Gouache painting of a kitchen counter crowded with bowls around one large vermilion bowl of tomatoes

Cached Data Per Object in Memory: Read the Buffer Pool

March 31, 2021
Pinal Dave
SQL Performance
SQL DMV, SQL Memory, SQL Scripts, SQL Server

Cached data per object tells you which tables and indexes fill the buffer pool. This post builds two demo tables, empties their cache and reads part of the data. A query then lists the pages, megabytes and share of each index in memory. It also explains why the view is costly on a big server.

Read More
Gouache painting of a narrow water channel with a vermilion board across it and water flowing past

Disable Adaptive Join for One Query or a Whole Database

March 30, 2021
Pinal Dave
SQL Performance
Execution Plan, SQL Joins, SQL Scripts, SQL Server

To disable adaptive join for one query, add a USE HINT to it. This post also shows a Query Store hint for code you cannot edit and the database setting that switches the feature off for everything. Each switch is tested on a small demo database and checked in the plan.

Read More
A horse collar hanging neatly with one fastening left open

Job Steps That Fail While the Agent Job Reports Success

March 29, 2021
Pinal Dave
SQL Tips and Tricks
SQL Reports, SQL Server, SQL Server Agent

A green job history does not mean every step worked. Decode the failure routing and pair failed steps with their outcomes.

Read More
Previous 1 … 23 24 25 26 27 28 29 … 420 Next
  • Books
  • Testimonials
  • Privacy Policy

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