Hey, you can simply call the below table value function and you are done, give it a try 🙂
ALTER FUNCTION [dbo].[ConvertStringToTable]
(
@ArrayString nvarchar(1000),
@Seperator char(1) = ','
)
RETURNS @ResultedTable TABLE (Val NVARCHAR(100))
AS
BEGIN
INSERT @ResultedTable
SELECT...