Saturday, February 25, 2012

Query by length of varchar column

Hi mates,

I have a Table:Test with column text:varchar(255). I want get rows where text length to be longer than 100. Is it possible?

Thx in advance,

Look at LEN and DATALENGTH functions in BOL.

select *

from TableName

where datalength(colName) > 100

|||Thx very much!

No comments:

Post a Comment