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 =LEFT(Code,PATINDEX('%/%',Code)-1)
,RightPart=SUBSTRING(Code,CHARINDEX('/',Code)+1,LEN(Code))
From @t x