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
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
SQL SERVER - Explanation and Understanding NOT NULL Constraint

SQL SERVER – Explanation and Understanding NOT NULL Constraint

October 15, 2007
Pinal Dave
SQL Performance
SQL Constraint and Keys, SQL Joins, SQL NULL, SQL Scripts

What a NOT NULL constraint does and two ways to add one: when the table is created, or after the table is created. My example covers both.

Read More
SQL SERVER - Explanation and Comparison of NULLIF and ISNULL

SQL SERVER – Explanation and Comparison of NULLIF and ISNULL

June 22, 2007
Pinal Dave
SQL Tips and Tricks
DBA, SQL Function, SQL NULL, SQL Scripts, SQL Server

NULLIF returns NULL when two expressions are equal and the first one when they are not. Here is how it compares with ISNULL and the matching CASE expression.

Read More
SQL SERVER - LEN and DATALENGTH of NULL Simple Example

SQL SERVER – LEN and DATALENGTH of NULL Simple Example

June 12, 2007
Pinal Dave
SQL Performance
SQL Function, SQL NULL, SQL Scripts

A common mistake is checking LEN(@var) = 0 for a NULL value. LEN and DATALENGTH of NULL both return NULL, not zero, as this simple example shows.

Read More
Previous 1 2 3 4
  • Books
  • Testimonials
  • Privacy Policy

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