SQL server LEN() 函数、DataLength() 函数,求某个字段长度


select l.COMPLETED_DESC,
case when DataLength(COMPLETED_DESC) >0 then 1 else 0 end as d from ICOM_ITEM_OF_LIST l where l.IS_DELETED='0'  order by l.put_time desc

LEN() 函数返回文本字段中值的长度。

DataLength() 函数返回文本字段中值的字符长度。

具体例子见下: