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
Open poultry shears sit around an empty gap beside a cut piece of chicken on a clean board

CHECK Constraints and NULL: Why Unknown Passes the Test

August 13, 2012
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Error Messages, SQL NULL, SQL Table Operation

Why does a CHECK (Quantity > 0) happily store a row with no quantity? Three-valued logic, a small demo, and the NOT NULL fix.

Read More
Two shoes sit immediately on opposite sides of a narrow doorway threshold strip

DATEDIFF Counts Boundaries, Not Time: Getting Durations Right

July 10, 2012
Pinal Dave
SQL Tips and Tricks
Mathematics, SQL DateTime, SQL Function, SQL NULL

A report can say one year of service after a single day. Here is why DATEDIFF does that, and what to use instead.

Read More
SQL SERVER - A Puzzle - Fun with NULL - Fix Error 8117

SQL SERVER – A Puzzle – Fun with NULL – Fix Error 8117

May 24, 2012
Pinal Dave
SQL Puzzle
SQL NULL, SQL Scripts, SQL Server

NULL is fun to ask about in interviews, since every answer I get is different. A short puzzle on NULL that raises Error 8117, and how to fix it.

Read More
puzzle

SQL SERVER – Solution Part 2 – A Quick Puzzle on SQL JOIN and NULL – SQL Brain Teaser

February 17, 2012
Pinal Dave
SQL Puzzle
SQL Joins, SQL NULL, SQL Scripts, SQL Server

Part 2 of the solution to my puzzle on SQL Join and NULL. Readers still email me answers every day, so here are more of the good ones they sent.

Read More
Five crochet hooks in olive, blue, cream, blue and red stand in a row, with the red hook tallest

ANY and ALL: Comparing a Value to a Whole Subquery in T-SQL

August 22, 2011
Pinal Dave
SQL Tips and Tricks
SQL NULL, SQL Operator, SQL Sub Query, Temp Table

One missing price is enough to make ALL return nothing while ANY returns rows. Here is how to see it, and how to ask the question more safely.

Read More
One brass key blank fits a precise profile jig while a similar blank with a different ridge rests outside

LIKE Character Ranges: [a-f], [^0-9] and Collation Traps

August 9, 2011
Pinal Dave
SQL Tips and Tricks
SQL Collation, SQL NULL, SQL String, Unicode

A bracket range sounds simple until the collation decides what sits between a and f. Test it once so a bad code never reaches your table.

Read More
Error dialog explaining why a query does not throw an error.

SQL SERVER – Puzzle Involving NULL – Resolve – Error – Operand data type void type is invalid for sum operator

June 27, 2011
Pinal Dave
SQL Puzzle
SQL NULL, SQL Operator, SQL Scripts, SQL Server

SELECT SUM over a lone NULL throws Msg 8117: Operand data type void type is invalid for sum operator. Here is why it happens and how ISNULL fixes it.

Read More
Previous 1 … 4 5 6 7 8 9 10 … 12 Next
  • Books
  • Testimonials
  • Privacy Policy

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