How do I check if a SQL Server text column is empty?

前端 未结 16 1172
粉色の甜心
粉色の甜心 2020-12-07 11:07

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 comp

16条回答
  •  暖寄归人
    2020-12-07 11:22

    Are null and an empty string equivalent? If they are, I would include logic in my application (or maybe a trigger if the app is "out-of-the-box"?) to force the field to be either null or '', but not the other. If you went with '', then you could set the column to NOT NULL as well. Just a data-cleanliness thing.

提交回复
热议问题