Splitting names in a SQLS 2K query ?
-
I've got rather a lot of cleaned data that has the title,first and last names stored as a single string in one column - is there a simplish way to split this out into 3 columns. e.g something like this ? select splitTitle(name) as title, splitFirst(name) as first, splitLast(name) as last from myTable Also what books do people recommend for learning this kind of stuff ? Many thanks for any help
-
I've got rather a lot of cleaned data that has the title,first and last names stored as a single string in one column - is there a simplish way to split this out into 3 columns. e.g something like this ? select splitTitle(name) as title, splitFirst(name) as first, splitLast(name) as last from myTable Also what books do people recommend for learning this kind of stuff ? Many thanks for any help
Hi Jerry, You can split the values using substring and charindex in SQL Server. I guess, you have to write a stored procedure to split them based on delimiter by passing concatinated string and delimiter and get title, first and last names. I can help you in this, if you try out something.. Thanks, Srinivas