开发者

why should I use Len(columnName) instead of columnName='' (sql server 2008)

Just wondering 开发者_Go百科 I colleague said to me don't use columnName='' instead use Len(columnName)==0

This happened when I was querying something and I wanted all columns in my table where the value was null or empty.

Is there any benefit in using len i/o testing for empty string? I cannot see any.

thanks


If you want the rows where the value is empty string or null you should do like this.

where Col = '' or Col is null

Using len(Col) will not give you the the rows with null values.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜