Click here to Skip to main content
15,890,407 members
Articles / Programming Languages / SQL

Counting the number of occurrences of one string inside another in SQL

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
15 Aug 2011CPOL 10.8K  
CREATE FUNCTION [dbo].[com_CountString](@Input nVarChar(max), @SearchString nVarChar(1000))RETURNS INTBEGIN if @Input is null or @SearchString is null return 0 DECLARE @InputLength INT, @SearchLength INT SELECT...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
New Zealand New Zealand
I've spent time programming for the security industry, video games, and telephony. I live in New Zealand, and have a Bachelor of Computing and Mathematical Sciences specializing in Computer Technology, from the University of Waikato in Hamilton, New Zealand.

Comments and Discussions