To convert empty string to NULL in a date column, wrap the text in NULLIF before you cast it. A plain CAST returns 1900-01-01 and hides the problem. This post tests five expressions on six text values, including a real 1900 date, a run of spaces and a tab, and shows which ones stay correct.
NOT IN With a NULL in the List Returns No Rows
See why NOT IN with a NULL returns no customers, then compare five sample rows, NOT EXISTS, an IS NOT NULL filter, and query plans.
Add Columns With NULL in SQL Server: ISNULL, COALESCE or SUM
To add columns with NULL in SQL Server, first decide what an empty value means. This post sums three nullable columns with the plus operator, ISNULL, COALESCE and SUM, shows where each one differs on a row of all NULLs, and compares their CPU cost on two million rows.
SQL SERVER – NULL Values and CONCAT Function
A lot of SQL in the Sixty Seconds video recently, we will be looking at a very interesting T-SQL CONCAT function and how it works with the NULL Values.
SQL Puzzle – Solution to Strange Results – IN and IS NOT NULL –
Earlier I had published a blog post about a puzzle SQL Puzzle – IN and IS NOT NULL – Strange Results. Today we will see a solution to strange results puzzle.
DEFAULT WITH VALUES: Fill Existing Rows on a New Column
DEFAULT WITH VALUES fills the rows that already exist when you add a column with a default. Without it, a nullable column keeps NULL in every old row. This post shows the three cases side by side, what a default never does, why the constraint needs a name, and how a large table takes the change in a millisecond.
SQL Puzzle – IN and IS NOT NULL – Strange Results
Today, let us see a very simple puzzle where we are getting strange results when using NOT IN and IS NULL in a T-SQL query.





