Can you split the one column in to two columns
For Ex:FullName:Aswini Aluri
It must split into firstname: Aswini.
LastName :Aluri

 Posted by aswinialuri-19361 on 3/11/2013 | Category: Sql Server Interview questions | Views: 4237 | Points: 40

create table splitS(FullName NVARCHAR(50))
select LEFT(fullname, CHARINDEX(' ', fullname + ' ') -1),
STUFF(fullname, 1, Len(FullName) +1- CHARINDEX(' ',Reverse(fullname)), '')
from splitS

insert into splitS values('ASWINI ALURI')

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response

More Interview Questions by aswinialuri-19361