SQL - Find Occurrences of string

DECLARE @FindSubString VARCHAR(MAX)
--SET @LongSentence = 'My Super Long String With Long Words'
SET @FindSubString = 'document.getElementById("clinical_form_date").value=GetFormattedDate();'

Select *,('pdate [ClinicalSession] Set [Form]=replace([Form],''document.getElementById("clinical_form_date").value=GetFormattedDate();'','''') Where Session_Id='+ Convert(varchar,Session_Id)) as Query from (
  select (Select pfname + ' '+ plname from pat WHERE Pat.pid=CSL.Patient_ID) as FN,CS.Session_Id,(LEN([Form]) - LEN(REPLACE([Form], @FindSubString, '')))/LEN(@FindSubString) CntOccuranceChars
from ClinicalSessionLink CSL inner join ClinicalSession CS on CS.Session_Id=CSL.Session_ID
)TEMP
WHERE TEMP.CntOccuranceChars>0 AND FN not like '%test%'
Order BY CntOccuranceChars DESC