Wednesday, November 01, 2006 - Posts

Fulltext - How to get a word hitcount

My blog has moved to sqlblogcasts.com/blogs/simons
The full version of this post can be found here., http://sqlblogcasts.com/blogs/simons/Fulltext - How to get a word hitcount
The new RSS feed is here

Saw this on the newsgroups and thought it was really neat. To get the number of times a word occurs in a column you can do

SELECT PKCol,
hitcount=(len(TextCol)-len(replace(TextCol,'WordToFind','')) )/len('WordToFind')

... To read the complete version of this post go here, http://sqlblogcasts.com/blogs/simons/Fulltext - How to get a word hitcount