SQL Server Performance Forum – Threads Archive
One field into three
Hi. I have name field as person_name in my database as one field. I want to produce a report in the formate of first_name,last_name and middle_name. How can splet the one name field into three. For example i have the data asHaja Moinudeen Mohammed
what i need is
First_name :Haja
Middle_name :Moinudeen
Last_name :Mohammed
If i use left of and right of functions it will fetch fixed no of characters it may leads to wrong result. Plz help me for my solution. Thanks..
Its a presentation layer and you can do with
Select FirstName + " " + LastName
and look into Concatenation topic in Books online.
Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
Note that you might need to takt NULLs into account and thus might be better off, wrapping the columns in ISNULL(). —
Frank Kalis
Moderator
Microsoft SQL Server MVP
Webmaster:http://www.insidesql.de
Haha, got fooled by satya’s reply! [<img src=’/community/emoticons/emotion-1.gif’ alt=’

Doh, I had thought in concatenation way as mixed up with another question. [:I]http://www.databasejournal.com/features/mssql/article.php/3071531 fyi
Ignore my reply…. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
I agree with presentation part [<img src=’/community/emoticons/emotion-2.gif’ alt=’


]]>