clear markdown compare help donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 462209 distinct fiddles created so far.

CREATE FUNCTION GetStringCount(@strValue VARCHAR(200), @charValue VARCHAR(200)) RETURNS VARCHAR(200) AS BEGIN RETURN (DATALENGTH(@strValue) - DATALENGTH(REPLACE(@strValue, @charValue, ''))) / DATALENGTH(@charValue) END
 hidden batch(es)


SELECT dbo.GetStringCount('Hello World', 'l'); -- 3
(No column name)
3
 hidden batch(es)


SELECT dbo.GetStringCount('Test Test', 'es'); -- 2
(No column name)
2
 hidden batch(es)