http://stackoverflow.com/questions/9444638/null-vs-empty-in-sql-server

0

Please login or register to vote for this query.

(click on this box to dismiss)

Russian Language

Q&A for students, teachers, and linguists wanting to discuss the finer points of the Russian language

SET NOCOUNT ON;
DECLARE @tbl AS TABLE (value varchar(50) NULL, description varchar(50) NOT NULL);

INSERT INTO @tbl VALUES (NULL, 'A Null'), ('', 'Empty String'), ('Some Text', 'A non-empty string');

SELECT * FROM @tbl;
SELECT * FROM @tbl WHERE value IS NOT NULL;
SELECT * FROM @tbl WHERE value <> '';

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results