Hello Friends,

In continuation to my previous post, I’m going have chosen another function from SQL Server 2016 to put forward here.

New STRING_SPLIT() function in SQL Server 2016 to split a string into multiple values & rows. Function returns table from a string parameter

Type of Parameter : VARCHAR, NVARCHAR, CHAR and NCHAR

Count of parameters: 2 (Two) – string and separator. It returns a table.

Accept NULL or BLANK: NO

In case of passing NULL OR BLANK parameter it will throw an error, listed below.

screen-shot-2016-10-24-at-1-42-57-pm

SYNTAX:

STRING_SPLIT(string,separator)

Here is quick example, how it works.

screen-shot-2016-10-26-at-6-11-46-am

Sorry about RED mark under function, something malicious in my environment. :(

Happy Learning!

Like us on FaceBook | Join the fastest growing SQL Server group on FaceBook

Follow Avanish Panchal on Twitter | Follow Avanish Panchal on FaceBook