Hah... loko this is what I had come up with but I got errors when I tried various combinations:
declare @string varchar(100) = 'surname, forename, middlename'
declare @string varchar(100) = ', forename, middlename'
select *
from dbo.TableFromList(@string)
DECLARE @Master_Surname NVARCHAR(200)
DECLARE @Master_Forename NVARCHAR(200)
DECLARE @Master_MiddleName NVARCHAR(200)
select @Master_Surname = substring(@string, 1, charindex(',', @string)-1)
select @Master_Surname
select @Master_Forename = substring(ltrim(replace(@string, @Master_Surname+',', '')), 1, charindex(',', (ltrim(replace(@string, @Master_Surname+',', ''))))-1)
select @Master_Forename
select @Master_MiddleName = reverse(left(reverse(@string), charindex(',', reverse(@string))-1))
select @Master_MiddleName
I will try your version now!
---------------------------------------------------------
It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens[/url]
Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn