Want to split string value according to its spectator pattern.
For e.g Input string is 'A,B,C,' . Function should return table for this input string value as below.No X 1 A 2 B 3
Have written below function, But its not working as expected.
CREATE FUNCTION FN_STRING_SPLIT (IP_STRING NVARCHAR(5000)) RETURNS TABLE (A NVARCHAR(50))
LANGUAGE SQLSCRIPT AS
/*V_OUT1 = SELECT * FROM :V_OUT1 UNION SELECT * FROM :V_OUT;*/
RETURN select :V_OUT1 as A from dummy;
Please suggest proper solution.
Thanks in advance.