Hi @Rahul Polaboina ,
Try this query:
Create table #employee
(
empdetails varchar(max)
)
insert into #employee values('hill.1')
insert into #employee values('Jim.kim.2')
insert into #employee values('sam.3')
insert into #employee values('vic.gin.4')
select * from #employee
select left(empdetails,len(empdetails)-charindex('.',REVERSE(empdetails))) as empname
,left(REVERSE(empdetails),CHARINDEX('.',REVERSE(empdetails))-1) as empid
from #employee
Best regards,
Niko
----------
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.