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.
| Author |
Topic |
|
khusiie
Yak Posting Veteran
78 Posts |
Posted - 2009-09-22 : 12:00:08
|
| i have fullname - one column in a table and i want to differentiate first name and last name(two columns) from that fullname - one column example:its id,fullname, date,quantity---------------------------1 William Guard 1/1/2006 25.002 Rhodes Jason 4/14/2007 523.003 Helley Simpson 9/25/2008 0.0i want like-id firstname lastname date quantity---------------------------------------1 William Guard 1/1/2006 25.002 Rhodes Jason 4/14/2007 523.003 Helley Simpson 9/25/2008 0.0how can i get firstname and lastname from fullname?thanks |
|
|
Hommer
Aged Yak Warrior
808 Posts |
Posted - 2009-09-22 : 12:25:31
|
| well, for the example data, it wouldn't be too hard. You could plit them up by the space.however, I suspect your real data is more complex. Contains something like these:Such asEd Smith IIDr. Al SmithDave A. SmithMarry Ann Smith |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2009-09-24 : 15:33:25
|
| This function will split complex names into their components:http://sqlblindman.pastebin.com/f68f37c15________________________________________________If it is not practically useful, then it is practically useless.________________________________________________ |
 |
|
|
|
|
|