sql server 2016 split string
snippet in sql

sql server 2016 split string

user6168

SELECT value FROM STRING_SPLIT('Lorem ipsum dolor sit amet.', ' ');

create table split string function in sql server

user4877


        
            
        
     SELECT 
    first_name, 
    last_name,
    value phone
FROM 
    sales.contacts
    CROSS APPLY STRING_SPLIT(phones, ',');

sql split string by space

user3957

SELECT SUBSTRING('please notify the sender at the e-mail address above',0,30 +
charindex(' ',SUBSTRING('please notify the sender at the e-mail address above',31,len('please notify the sender at the e-mail address above')))
 )
 as part1,
 
 SUBSTRING('please notify the sender at the e-mail address above',30+ charindex(' ',SUBSTRING('please notify the sender at the e-mail address above',31,len('please notify the sender at the e-mail address above'))),len('please notify the sender at the e-mail address above')) as part2