In SQL server 2005 this query
select len(cast('the quick brown fox jumped over the lazy dog' as varchar))
returns 30 as length while the supplied string has more characters. This seems to be the default. Why 30, and not 32 or any other power of 2?
[EDIT] I am aware that I should always specifiy the length when casting to varchar but this was a quick let's-check-something query. Questions remains, why 30?
See Question&Answers more detail:os