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 small basket of green apples sits before larger baskets filled with apples and pears.

COUNT OVER: Show the Filtered Total Beside Page Rows

November 2, 2010
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Order By, SQL Scripts, SQL Server

COUNT OVER helps me keep a page’s row count separate from the filtered total. Compare full and partial pages. An empty page needs an explicit total-count contract.

Read More
Gouache painting of a shelf of cloth-bound books with one book tilted out of the row and a vermilion ribbon bookmark hanging below it

Find the Last Read and Write Time of Every Table in SQL Server

October 31, 2010
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Index, SQL Scripts, SQL Server

Find the last read and write time of every table in SQL Server with sys.dm_db_index_usage_stats. The tests show what counts as a read, why an insert counts as a write, what an index rebuild does to the numbers, and what wipes them.

Read More
Gouache painting of a magnifying glass examining database views

SQL SERVER – List of all the Views from Database

October 29, 2010
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL View

Hundreds of Views and no idea which are indexed? A quick query on sys.views lists every view with its schema and whether it is indexed or indexable.

Read More
A half-mown lawn at dusk, the push mower parked where the last stripe ended, a red cloth on its handle.

Resumable ADD CONSTRAINT in SQL Server 2022: Pausing a Primary Key Build

October 26, 2010
Pinal Dave
SQL Tips and Tricks
Primary Key, SQL Constraint and Keys, SQL Index, SQL Server, SQL Server 2022

Use resumable ADD CONSTRAINT in SQL Server 2022 to pause a key build, inspect progress, resume safely, and understand abort behavior.

Read More
Gouache painting: seen from the side, a hillside of grapevines steps down in three terraces

hierarchyid GetLevel: Count the Path Depth

October 25, 2010
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts, SQL Server

hierarchyid GetLevel identifies depth within a logical path. The read-only example distinguishes the root, children, grandchildren and a fractional sibling label.

Read More
Uneven herb bundles on a brass balance beside a compartment tray of separate portions.

Stored Totals: Find Drift Before Repairing It

October 22, 2010
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Server

Stored totals can drift from their authoritative line amounts. This private demonstration finds two mismatches, retains empty orders and accepts valid credits. It checks decimal range before a private repair and explains why concurrency needs separate proof.

Read More
Gouache painting: two identical long dough logs lie parallel on a floured counter, each sliced into rounds of equal width

DATE_BUCKET: Align 15-Minute Windows With an Origin

October 21, 2010
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Server, SQL Server 2022

DATE_BUCKET uses an origin to align reporting windows. Keep width, unit and origin explicit while checking timestamps around each boundary.

Read More
Previous 1 … 326 327 328 329 330 331 332 … 416 Next
  • Books
  • Testimonials
  • Privacy Policy

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