Sunday, March 1, 2009

MS SQL Check for empty String

MS SQL one cannot use the <> '' on text, ntext and varchar data types:

SQL:

SELECT * FROM myTable WHERE myField LIKE '_%'

OR If you want to get all the field with empty string use

SQL:

SELECT * FROM myTable WHERE myField NOT LIKE '_%'

No comments: