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 tea shop counter where one small wooden crate is checked twice: once close up under a magnifying lens, and once from across the room on a wide shelf; the crate's tag is vermilion

BDD vs TDD: One Small Feature, Two Ways to Test It

August 31, 2023
Pinal Dave
SQL Tips and Tricks
Best Practices, Developer, Software Development, Testing

BDD vs TDD is easy to mix up until you test the same feature both ways. This post checks one delivery rule with a unit test and then with a plain-language scenario, runs the unit test, and explains when each approach fits.

Read More
A shell bead necklace with repeated shell colors beside one specimen of each color

Running Distinct Counts: Working Around COUNT(DISTINCT) OVER

July 27, 2023
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Performance, SQL Server

Your report wants unique customers so far, and SQL Server refuses COUNT(DISTINCT) over a window. Flag each first appearance and add up the flags instead.

Read More
A lawn bowls green with the jack in place, a bowl rolling toward it and a hand holding a measuring string.

Given-When-Then for Database Tests

July 24, 2023
Pinal Dave
SQL Tips and Tricks
Best Practices, Software Development, SQL Server, SQL Stored Procedure, Testing

Use Given-When-Then for readable database tests with known input, explicit THROW checks, and transaction rollback after each case.

Read More
Gouache painting of ten small terracotta pots of young herbs in a row on a potting bench, one pot vermilion.

Go Programming Language: 10 Interview Questions With Tested Answers

July 7, 2023
Pinal Dave
SQL Tips and Tricks
Best Practices, Go, SQL Scripts

The Go programming language is small, so ten questions cover most of an interview. This post answers each one in plain words with a tiny program. Every program was run twice on Go 1.27.1, and the real output is shown.

Read More
A sash window latch selecting one pane within a larger window frame

statement_start_offset: Showing the Exact Statement Running Now

February 10, 2023
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Performance, SQL Server

A stored procedure runs for forty minutes and you need the busy line. Here is how to pull it out of the batch text without the usual off-by-two mistakes.

Read More
Gouache painting of a long pegboard on a table with pliers, a saw, two vermilion-handled hammers, one set crosswise out of line

Performance Tuning Mistakes in SQL Server: 11 Habits to Fix

February 1, 2023
Pinal Dave
SQL Performance
Best Practices, SQL Backup and Restore, SQL Cursor, SQL Index, SQL Statistics

Performance tuning mistakes are habits, and each one has a check. Eleven sit in one table, and five are measured on a demo database: a missing index, stale statistics, a row by row loop, a giant delete and a type that cannot be indexed.

Read More
An electrotype mold kept separately beside an impression made from it

Updatable Ledger Tables: Proving No One Quietly Changed a Row

January 25, 2023
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Performance, SQL Server

Update a row in a ledger table and the old version stays. Then verify the history with a digest, and break the digest to see what failure looks like.

Read More
Previous 1 2 3 4 5 6 … 54 Next
  • Books
  • Testimonials
  • Privacy Policy

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