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

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1740464999, '52.14.6.24', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/SQL-Server/T-SQL/functions/string/split/index(64): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78