Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get number of words in a sql server field
Message
From
11/10/2007 09:14:31
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01260240
Message ID:
01260248
Views:
10
Perfect! Thanks Sergey :o)


>>I would like to determine the number of words in a field in a sql server table. Is there an easy way to do it? I really just need to know if there is more than one word in a field.
>
>Tracy,
>
>Assuming that words are separated by spaces and there are no leading spaces
>
>LEN(mycolumn) <> LEN(REPLACE(mycolumn, SPACE(1), SPACE(0)))
>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform