with cte as (
select 'LASTNAME : SMITH FIRSTNAME: JOHN' as name union all
select 'LASTNAME : DOE FIRSTNAME: Jane')
, rtrim(ltrim(substring(name, 11, CHARINDEX( 'FIRSTNAME:' , name )-11))) as lastname
, rtrim(ltrim(substring(name, CHARINDEX( 'FIRSTNAME:' , name )+10,999))) as firstname
Open in new window
IT issues often require a personalized solution. With Ask the Experts™, submit your questions to our certified professionals and receive unlimited, customized solutions that work for you.
Take hold of your future.