Does anyone know a good way to count characters in a text (nvarchar) column in Sql Server? The values there can be text, symbols and/or numbers.
So far I used sum(datalength(column))/2 but this only works for text. (it's a method based on datalength and this can vary from a type to another).
sum(datalength(column))/2
You can find the number of characters using system function LEN. i.e.
LEN
SELECT LEN(Column) FROM TABLE
2.1m questions
2.1m answers
60 comments
57.0k users