How to use NULL or empty string in SQL How to use NULL or empty string in SQL sql-server sql-server

How to use NULL or empty string in SQL


Select *From TableWhere (col is null or col = '')

Or

Select *From TableWhere IsNull(col, '') = ''


If you need it in SELECT section can use like this.

SELECT ct.ID,        ISNULL(NULLIF(ct.LaunchDate, ''), null) [LaunchDate]FROM   [dbo].[CustomerTable] ct

You can replace the null with your substitution value.


You can simply do this:

SELECT *FROM   yourTableWHERE  yourColumn IS NULL OR yourColumn = ''