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 hand watering the one dry pot in a row of geraniums on a porch step, the other pots left alone

Skipping No-Op Updates: Changing Only Rows That Really Differ

December 16, 2019
Pinal Dave
SQL Tips and Tricks
SQL NULL, SQL Scripts, SQL Server, SQL Server 2022, SQL Trigger

Skip no-op updates with NULL-safe EXCEPT or IS DISTINCT FROM, inspect affected counts, and avoid unnecessary rowversion and trigger changes.

Read More
Gouache painting of a tray of cream, sage and slate thread spools with one spool wearing a vermilion ring

Nullable Columns in a Database: List Them and Count NULLs

December 12, 2019
Pinal Dave
SQL Tips and Tricks
SQL Column, SQL NULL, SQL Scripts

Nullable columns in a database cost you ISNULL calls and OR IS NULL conditions in every query. This post lists them with a catalog query, compares the INFORMATION_SCHEMA version, and counts the real NULLs in each column. The count tells you which columns can become NOT NULL and which can go.

Read More
Gouache painting of a row of wicker baskets on a bench beside a full shelf of oven rolls, one basket holding a vermilion item

Queries Waiting for Memory: Read the Grant Counters

December 10, 2019
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Memory, SQL Scripts

Queries waiting for memory are counted by the Memory Grants Pending counter and listed by sys.dm_exec_query_memory_grants. A tested demo holds a sort grant of 41,848 KB with a blocked query and reads it from the view. The post explains how to spot a waiting request and what causes the wait.

Read More
Gouache painting of two matching baskets of sage pears on a market stall, one holding a single vermilion pear

Missing tempdb Files: master_files vs database_files

December 6, 2019
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL TempDB

Missing tempdb files show up as a mismatch between sys.master_files and tempdb.sys.database_files. This post compares the two with a query, simulates the missing files on a copy of the catalog, and shows the error log message that gives the cause. The fix is to correct the path and restart.

Read More
Gouache painting of two weathervanes on one roof pointing opposite ways, one in vermilion

Task Manager Update Speed: Why the CPU Graph Looks Stuck

November 26, 2019
Pinal Dave
SQL Tips and Tricks
SQL CPU, SQL Scripts, Windows

Task Manager update speed controls how often the CPU graph moves. When it is set to Paused, the graph freezes and a normal server can look like it has a CPU problem. This post shows the fix and a five second test in T-SQL that tells you whether the graph is alive.

Read More
Gouache painting of a clear glass measuring jug of water on a veranda rail beside a small stone and a folded cloth

STATISTICS TIME and IO: Turn Them On for Every SSMS Query

November 23, 2019
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server Management Studio, SQL Shortcut, SQL Statistics

To get STATISTICS TIME and IO for every query, tick two boxes in the SSMS options once instead of typing SET STATISTICS in each window. This post builds a small demo, reads the output line by line, shows that a SELECT and an UPDATE both report their cost, and explains which windows the option affects.

Read More
Gouache painting of a tangled old thread spool beside a fresh vermilion spool on a sewing table

Procedure Recompilation: Force a New Plan in SQL Server

November 22, 2019
Pinal Dave
SQL Tips and Tricks
Execution Plan, SQL Scripts, SQL Stored Procedure

Procedure recompilation builds a new plan without changing the procedure. A tested demo compares EXEC with WITH RECOMPILE and sp_recompile on a skewed table, with 100,089 reads on a stale plan and 348 on a fresh one. It also shows that sp_recompile removes every cached plan of the procedure.

Read More
Previous 1 … 64 65 66 67 68 69 70 … 570 Next
  • Books
  • Testimonials
  • Privacy Policy

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