question

siera_gld avatar image
siera_gld asked

Parse Last Name from Column

I have a name stored as Smith PA,John E in a table of Doctors. How would I parse the last name "Smith" and First Name "John" from this list? Not all providers have the names formatted the same way. Some will have PA, MD, etc... and some will not.
t-sqlparse
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
@SQLShark avatar image
@SQLShark answered
Hi there, A very similar question was asked a few days ago. There are some good answers including some commentary on how difficult it is to ensure that any rule you apply will work for all cases. [ http://ask.sqlservercentral.com/questions/114687/parsing-full-name-to-first-mid-last.html][1] [1]: http://ask.sqlservercentral.com/questions/114687/parsing-full-name-to-first-mid-last.html
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.