clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2335872 fiddles created (27455 in the last week).

CREATE FUNCTION STRING_SPLIT_POLYFILL2016 ( @string NVARCHAR(4000) ,@separator NVARCHAR(4000) ) RETURNS @T TABLE (ColName VARCHAR(4000)) AS BEGIN /* pitt phunsanit polyfill of STRING_SPLIT in SQL Server 2016 https://docs.microsoft.com/en-us/sql/t-sql/functions/string-split-transact-sql?view=sql-server-ver15 https://stackoverflow.com/questions/46902892/string-split-in-sql-server-2012 */ DECLARE @Number VARCHAR(4000); SET @string = @string + @separator; WHILE CHARINDEX(@separator, @string) > 0 BEGIN SET @Number = SUBSTRING(@string, 0, CHARINDEX(@separator, @string)); SET @string = SUBSTRING(@string, CHARINDEX(@separator, @string) + 1, LEN(@string)); INSERT INTO @T (ColName) VALUES (@Number) END RETURN END
 hidden batch(es)


DECLARE @IDS NVARCHAR(4000) SET @IDS = 'pitt,phunsanit,01,02,03,4,5,6,7,8,9,10,พิชญ์,พันธุ์สนิท'; SELECT * FROM STRING_SPLIT_POLYFILL2016(@IDS, ',')
ColName
pitt
phunsanit
01
02
03
4
5
6
7
8
9
10
?????
??????????
 hidden batch(es)