SoftadminUtil.String_Split

Type: Table-valued function

(SQL Server 2016 introduced the built-in function STRING_SPLIT. Its behavior is not identical to SoftadminUtil.String_Split so you can not simply replace calls to one with the other, but you should consider writing new code using the built-in function.)

Splits the supplied string into several substrings at a specific character or sequence of characters. Each substring is returned on a separate row in the resultset.

If the supplied value is an empty string then a single row with the value null is returned.

If the supplied value is null then no rows are returned.

Example

SoftadminUtil.String_Split('these are my words', ' ')
ID Txt
1 these
2 are
3 my
4 words

Parameters

@Txt mandatory nvarchar(max)
The text to split.
@Delimiter mandatory nvarchar(4000)
The delimiter. If this is null the entire string is returned. If it is an empty string each character will be returned on a separate line.

Resultsets

Resultset: String fragments

Each fragment is returned on a separate row.

If you need the rows be in order then you should explicitly use an ORDER BY on the ID column.
Table count: repeated exactly once
Row count: zero or more rows
Columns
ID mandatory int

Row number. This value reflects the value's position in the string, that is, if you split the string A,B,C on , then the ID of A will be 1, the ID of B will be 2, and the ID of C will be 3.

Txt mandatory string
Fragment