Search notes:

SQL Server function: string_split

string_split is a table valued function, that is, it returns table data.
One of the possibly easiest examples that demonstrate string_split might be the following:
select
   t.value
from
   string_split('foo,bar,baz', ',') t;
--
-- value
-- -----------
-- foo
-- bar
-- baz
Github repository about-MSSQL, path: /t-sql/functions/string/split/simple.sql
The next example combines string_split with convert() to explicitly return an integer.
select
   convert(int, t.value) as i
from
   string_split('42,99,1', ',') t
--
-- i
-- -----------
-- 42
-- 99
-- 1
Github repository about-MSSQL, path: /t-sql/functions/string/split/integers.sql

See also

T-SQL functions

Index