There probably is some function already built in, but you could do it using SP as shown below
CREATE proc aa_test
(
@pi_instr VARCHAR(10),
@pi_SearchChar CHAR(1)
)
AS
BEGIN
DECLARE @v_Str VARCHAR(10)
DECLARE @v_found INT
SET @v_found = 0
SET @v_Str = @pi_Instr
WHILE len(@v_str) > 0 and @v_found = 0
BEGIN
IF LEFT(@v_Str, 1) = @pi_SearchChar
BEGIN
SET @v_found = 1
BREAK
END
ELSE
SET @v_Str = right(@v_str, len(@v_str) - 1)
END
SELECT @v_found
RETURN @v_found
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.