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)

Physics

Q&A for active researchers, academics and students of physics

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