---
title: "How do I check if a SQL Server text column is empty?"  
description: "How do I check if a SQL Server text column is empty?"  
author: "Manoj Bhatt"  
published: 2013-02-14  
updated: 2013-02-16  
canonical: https://www.mindstick.com/forum/602/how-do-i-check-if-a-sql-server-text-column-is-empty  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 1 minute  

---

# How do I check if a SQL Server text column is empty?

Hi MindStickians!

I am using [SQL Server](https://www.mindstick.com/articles/12999/what-is-table-valued-function-in-sql-server) 2005. I have a table with a text [column](https://www.mindstick.com/forum/33860/how-to-calculate-column-summary-in-sql-server) and I have many rows in the table where the value of this column is [not null](https://www.mindstick.com/interview/1933/what-is-not-null-constraint), but it is empty.

Trying to [compare](https://www.mindstick.com/forum/2036/propertyinfo-getvalue-unable-to-compare-datetimes) [against](https://yourviews.mindstick.com/view/81332/the-approach-of-science-against-disease-epidemics) '' yields this [response](https://www.mindstick.com/forum/12719/how-to-make-response-write-display-special-character-like-lt-gt):

The data types text and [varchar](https://www.mindstick.com/forum/161878/what-is-the-difference-between-nvarchar-and-varchar) are incompatible in the not equal to operator.

Is there a special [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) to [determine whether](https://www.mindstick.com/forum/161622/how-do-you-determine-whether-a-file-is-locked-or-in-use-by-another-process) the value of a text column is not null but empty?

Thanks!

## Replies

### Reply by AVADHESH PATEL

Hi Manoj!

For check empty value try this "where" clause

where datalength(mytextfield)=0


---

Original Source: https://www.mindstick.com/forum/602/how-do-i-check-if-a-sql-server-text-column-is-empty

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
