Let's say we have a table as
Declare @t Table(Code varchar(20) )
insert into @t values('AAAA/00001')
insert into @t values('BBB/00010')
insert into @t values('CCC/00002')
insert into @t values('ZZZ/00100')
We need to Extract Left and Right Part from Code
The below code will do so
Declare @t Table(Code varchar(20) )
insert into @t values('AAAA/00001')
insert into @t values('BBB/00010')
insert into @t values('CCC/00002')
insert into @t values('ZZZ/00100')
Select
LeftPart =PARSENAME(REPLACE(Code,'/','.'),2)
,RightPart=PARSENAME(REPLACE(Code,'/','.'),1)
From @t x