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 lunch thermos retaining one prepared meal for repeated servings

CTE or Temp Table: Choosing Where an Intermediate Result Lives

October 3, 2023
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

A CTE is a name, not a saved result. Build both versions on 20,000 rows, compare the plans, and see why the answer is never always one or the other.

Read More
A cheese press holding differently sized portions beside equivalent weighed pieces

Unit of Measure Conversions: One Table for Kilograms, Pounds and Boxes

August 23, 2023
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

Adding kilograms, pounds and boxes gives a number that means nothing. Convert each product to one base unit and find the rows that cannot convert.

Read More
Gouache painting of a row of clay tiles with one cracked tile marked by a vermilion dot and a magnifying glass

Find Damaged Pages in SQL Server With suspect_pages

July 12, 2021
Pinal Dave
SQL Tips and Tricks
Database Corruption, SQL Scripts, SQL Server DBCC, SQL System Table

Find damaged pages in SQL Server by reading msdb.dbo.suspect_pages. Decode the event type, find the table behind each page and know what to do next.

Read More
A hand pausing on a dusty draw-stop of an old church organ, the other stops polished from use

Finding Old Agent Jobs Not Run in Months or Never Scheduled

December 14, 2020
Pinal Dave
SQL Tips and Tricks
DBA, SQL Scripts, SQL Server Agent, SQL System Table

Review agent jobs not run recently or lacking schedules, combine history and activity, and disable approved candidates for review.

Read More
rowcount

Fastest Way to Retrieve Rowcount for a Table – SQL in Sixty Seconds #096

August 7, 2020
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL Scripts, SQL Server, SQL System Table

What is the fastest way to retrieve rowcount for a table?  Whenever I am helping my clients with their SQL Server, I get this question.

Read More
A ravioli press fitting different fillings into separately formed pasta parcels

Survey Answers: A Table Design for Questions and Responses

April 10, 2020
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

Store survey answers as typed rows instead of one column per question. Then break the design on purpose to see what it blocks and what it cannot.

Read More
A lacrosse stick transferring a ball from an unused basket toward an active basket

Counting Ranked-Choice Votes With a Loop and a Table

February 6, 2020
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

Four people rank three topics and nobody has a majority. Here is a small loop that eliminates the weakest topic, moves its ballots and logs every round.

Read More
1 2 3 4 … 18 Next
  • Books
  • Testimonials
  • Privacy Policy

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