Skip to main content

Count the Occurrence of a Phrase or Word in a Column

Simple little bit of code that will show you the number of times the value of @PhraseOrWordToCount is found in TextColumn. SELECT (LEN(TextColumn) – LEN(REPLACE(TextColumn, @PhraseOrWordToCount, ”)) / LEN(@PhraseOrWordToCount)) AS Occurrence FROM dbo.MyTable I noticed this on Simon Sabin’s blog, I think it has more applications than just FullText searches so I thought I’d do […]

Read More

SQL Server Agent Error: [LOG] The data portion of event 17052 from MSSQLSERVER is invalid

If you’re following Microsoft’s Best Practice recommendations for securing SQL Server 2000, you should be running the SQL Server and SQL Server Agent services under separate domain user accounts (not the Local System account). Whilst setting this up you may encounter this error: [LOG] The data portion of event 17052 from MSSQLSERVER is invalid Adding […]

Read More