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 a track splitting into four parallel tracks with a vermilion switch lever set to the wide side

Force a Parallel Plan: ENABLE_PARALLEL_PLAN_PREFERENCE Hint

August 27, 2019
Pinal Dave
SQL Performance
Parallel, Query Hint, SQL CPU, SQL Scripts

To force a parallel plan for one query, add the ENABLE_PARALLEL_PLAN_PREFERENCE hint to its OPTION clause. This post shows why a cheap query stays serial, runs a demo query with and without the hint, proves the difference from the last actual plan, and explains why the hint belongs in a test and not in every query.

Read More
Gouache painting of an old dusty wooden plane pushed aside next to a gleaming vermilion plane

DBCC DBREINDEX: Replace It With ALTER INDEX in SQL Server

August 26, 2019
Pinal Dave
SQL Performance
Maintenance Plan, SQL Deprecated Feature, SQL Index, SQL Scripts

DBCC DBREINDEX still runs on SQL Server 2025, but it is deprecated, and ALTER INDEX does everything it did and more. This post rebuilds a fragmented demo table both ways, shows the options only ALTER INDEX has, and finds old uses of DBCC DBREINDEX in your own modules, Agent jobs and the deprecation counter.

Read More
A small water gate controls which stream continues down a channel

How to Use a CASE Statement in the WHERE Clause? – Interview Question of the Week #239

August 25, 2019
Pinal Dave
SQL Interview Questions and Answers
SQL Sample Database, SQL Scripts, SQL Server

Question: How to Use a CASE statement in the WHERE Clause? Answer: First of all – CASE is not a statement but rather an expression.

Read More
Gouache painting of a balance scale tipping toward a vermilion basket of apples against a few pears

Read Heavy Workload or Write Heavy: Measure It in SQL Server

August 24, 2019
Pinal Dave
SQL Performance
SQL Counter, SQL DMV, SQL Scripts, SQL Server

To tell a read heavy workload from a write heavy one, compare what the server reads with what it changes, and measure it over a window. This post counts reads and writes per table, reads the buffer and log counters with two snapshots, and explains what each lens misses.

Read More
Gouache painting of three differently shaped tea cups on a bamboo tray beside a slate blue teapot, the small one vermilion

PRINT Date Format in SQL Server: PRINT Versus SELECT

August 23, 2019
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL String

The PRINT date format differs from the SELECT format, because PRINT converts the value to text first. This post tests PRINT with six date and time types, shows why joining text and a datetime fails with Msg 241, shows how the session language changes the month name, and gives the formats that stay the same everywhere.

Read More
Gouache painting of three windows of different shapes in a courtyard wall all showing the same vermilion flowerpot

Actual Execution Plan in SQL Server: Graphical, Text and XML

August 22, 2019
Pinal Dave
SQL Performance
Execution Plan, SQL Scripts, SQL Server, SQL Server Management Studio

An actual execution plan shows how SQL Server really ran a query, with the true row counts beside the estimates. This post gets the plan three ways, as a graphical plan, as text with SET STATISTICS PROFILE and as XML, and uses a demo table to show how the estimate and the actual number can disagree.

Read More
Gouache painting of a row of watering cans on a bench with one leaking vermilion can

IO Stalls by Database File: Find the File to Move

August 21, 2019
Pinal Dave
SQL Performance
Disk, SQL DMV, SQL Scripts, System Object

IO stalls measure how long SQL Server waited for the disk, file by file. This post ranks the files of a demo database by stall time, measures a workload with two snapshots, lists the busiest files of a whole instance, and explains how to pick the one file that belongs on the new drive.

Read More
Previous 1 … 148 149 150 151 152 153 154 … 843 Next
  • Books
  • Testimonials
  • Privacy Policy

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