How to split in Sql part [Resolved]

Posted by Jayakumars under .NET Framework on 3/4/2016 | Points: 10 | Views : 396 | Status : [Member] [MVP] | Replies : 1
Hi

SELECT 'ABCD/1234/1547/00001'

How to split here i need output

00001 only

Mark as Answer if its helpful to you


Responses

Posted by: Professionaluser on: 3/4/2016 [Member] [MVP] Bronze | Points: 50

Up
0
Down

Resolved
declare @var  varchar(100) ='ABCD/1234/1547/00001'
SELECT RIGHT(@var , CHARINDEX( '/', REVERSE(@Var ))-1) as OutCome


OutCome
00001


Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response