HOW DO I CHECK IF A SQL SERVER TEXT COLUMN IS EMPTY?

Manoj Bhatt

Total Post:154

Points:1086
Posted by  Manoj Bhatt
 2303  View(s)
Ratings:
Rate this:

Hi MindStickians!

I am using SQL Server 2005. I have a table with a text column and I have many rows in the table where the value of this column is not null, but it is empty.

Trying to compare against '' yields this response:

The data types text and varchar are incompatible in the not equal to operator.

Is there a special function to determine whether the value of a text column is not null but empty?

Thanks!

  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: How do I check if a SQL Server text column is empty?

    Hi Manoj!

    For check empty value try this "where" clause

    where datalength(mytextfield)=0

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!