SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Function for String Occurences Count

By Vignesh Arulmani,

This function is used to get the particular string occurences count from the given input string.

--examples
select dbo.fn_get_string_occurences_count('The quick brown fox jumps over the lazy dog','brown')
select dbo.fn_get_string_occurences_count('The quick brown fox jumps over the lazy dog','the')

Regards,

Vignesh Arulmani

Total article views: 1111 | Views in the last 30 days: 1
 
Related Articles
SCRIPT

String Character Count

A while ago I once attended an interview where I was asked to write a short script that counts each ...

FORUM

Function for String Occurences Count

Comments posted to this topic are about the item [B]Function for String Occurences Count[/B] Nice bu...

FORUM

Find last occurence of a character within a string

Find last occurence of a character within a string

FORUM

First occurence of number in string

Find the occurence of number in string and extract

BLOG

Count(*) or Count(1) ?

Every so often on the on-line forums, the question of : Which is better Count(*) or Count(1) ? will ...

Tags
 
Contribute