In SQL Server how we can count no of occurrence of a
character or word in a string.

Image 1.

Image 2.
DECLARE @string VARCHAR(MAX)='Noida, short for the New
Okhla Industrial Development Authority,
is a planned city in India under the
management of the
New Okhla Industrial Development Authority.It is
part of National Capital Region of India. '
DECLARE @tosearch VARCHAR(MAX)='In'
SELECT (DATALENGTH(@string) - DATALENGTH(REPLACE(@string,@tosearch,''))) / DATALENGTH(@tosearch)
AS OccurrenceCount