I have a table with a "name" column that I need to part out to seperate columns of first name, middle, last name. Such as
John Doe John | | Doe
Mary A Smith Mary | A | Smith
Bob Van Hushen Bob | | Van Hushen
Frank Williams Jr. Frank | | Williams Jr.
Bill R. White Bill | R | White
Is there anyone who could suggest a query that would be able to parse these names out as such? Or is there a function that would allow me to do this. I am using sql 7.
I have been only able to get the first name parted with this query,
substring(name,1,case when charindex(' ',name,1)> 0 then charindex(' ',name,1)-1
else len(name)end) as firstname
Can anyone help with some suggestions as to handle the rest of the name????
Thanks alot!
FrankW
John Doe John | | Doe
Mary A Smith Mary | A | Smith
Bob Van Hushen Bob | | Van Hushen
Frank Williams Jr. Frank | | Williams Jr.
Bill R. White Bill | R | White
Is there anyone who could suggest a query that would be able to parse these names out as such? Or is there a function that would allow me to do this. I am using sql 7.
I have been only able to get the first name parted with this query,
substring(name,1,case when charindex(' ',name,1)> 0 then charindex(' ',name,1)-1
else len(name)end) as firstname
Can anyone help with some suggestions as to handle the rest of the name????
Thanks alot!
FrankW