I have had a quick search but can't seem to get a working method of this, and I can't imagine it is the most difficult thing to do.
I have a list of about 1000 names from a client, all in the 'surname, forename' format.
I am loading them into a database but want them to be in the 'Forename Surname' format.
I have managed to get some working code to get the forename only but now need something that will get the surname only, and a way to do that is get delete all characters after and including the comma.
Cheers in advance
update my_table set name_field = substring(name_field, charindex(',', name_field) +1, 50) + ' ' +
substring(name_field, 1, charindex(',', name_field) -1)