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
Two clean leather shoes beside a dusty shoe being brushed

Non-Updating Updates: Skipping Rows That Would Not Change

August 21, 2012
Pinal Dave
SQL Tips and Tricks
DBA, SQL Scripts, SQL Server

An UPDATE that writes the same value still marks the row as modified. I show how IS DISTINCT FROM skips those rows and keeps NULL changes.

Read More
Two halves of a snap fastener join as one connection despite being presented from opposite sides

Unique Pairs in Either Order: Blocking A-B When B-A Exists

August 20, 2012
Pinal Dave
SQL Tips and Tricks
Computed Column, Duplicate Records, SQL Constraint and Keys, SQL Index

A plain unique index treats (1, 2) and (2, 1) as different rows. Two computed columns and one index fix that, and I test the awkward cases.

Read More
A staple remover exposes different metal staple shapes beside one intact fastening

Is This Instance Patched? Reading ProductUpdateLevel and Build

August 19, 2012
Pinal Dave
SQL Tips and Tricks
Cumulative Update, SQL Instance, SQL Monitoring, SQL Patch

An update label is one clue, the build number is the identity. I show how to read both, compare builds safely, and avoid the NULL typo trap.

Read More
SQL Server Relationships.

SQL SERVER – Curious Case of Disappearing Rows – ON UPDATE CASCADE and ON DELETE CASCADE – T-SQL Example – Part 2 of 2

August 17, 2012
Pinal Dave
SQL Tips and Tricks

Part 2 of the disappearing rows story: a T-SQL example showing how ON UPDATE CASCADE and ON DELETE CASCADE made my friend’s rows vanish, no virus involved.

Read More
Magnifying glass silhouette.

SQL SERVER – Curious Case of Disappearing Rows – ON UPDATE CASCADE and ON DELETE CASCADE – Part 1 of 2

August 16, 2012
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Server

Rows kept vanishing from a product table with no DELETE anywhere in the code. Part 1 of a puzzle that leads to ON UPDATE CASCADE and ON DELETE CASCADE.

Read More
A strip of stitched buttonholes shows distinct gaps between successive openings in cream cloth

Measuring Time Between Workflow Steps With LEAD

August 15, 2012
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Order By, SQL Reports

Status rows hold timestamps, not durations. I use LEAD to measure each step, keep unfinished steps NULL, and show why zero ruins your averages.

Read More
A cloakroom rail of identical dark coats, each hanger carrying a small tag in a different colour.

What Is a Primary Key, and What Happens Without One?

August 14, 2012
Pinal Dave
SQL Tips and Tricks
Best Practices, Database, SQL Index, SQL Server

A primary key is the promise that every row can be told apart. Why NULL is refused, what a table without one actually costs you, how it differs from a unique constraint, and when to choose a natural key over a made up one.

Read More
Previous 1 … 354 355 356 357 358 359 360 … 572 Next
  • Books
  • Testimonials
  • Privacy Policy

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