Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Need to break First Name; Last Name

Author  Topic 

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2008-03-19 : 14:41:11
I've got a field with first and last names together. I need to break it into two separate fields. One with first name; the other with last name.

How can I best do this?

thx,

John

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2008-03-19 : 14:50:13
Search for fnParseString on this forum. You should read through some of the threads since there are many caveats to parsing names. E.g., how would you handle Oscar De La Hoya?

Jim
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-03-19 : 15:26:47
Or Chikezie

use this:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=56499&SearchTerms=parse,name

EDIT:
if your names are dilimited as your subject suggests then yes, a parsing function, otherwise that link should do it.

Be One with the Optimizer
TG
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-03-19 : 15:59:33
Oscar De La Hoya! Perfect. We now have the definitive "Why Parsing First/Last Names Is Not As Easy As You Think" example.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2008-03-19 : 16:17:42
Thank you fellas,

I'll check them out and let you all know...

John
Go to Top of Page
   

- Advertisement -