The second one looks like the data up to the * but omitting the first 5 characters
The first omits the first 5 chars then takes the next 3 - not sure why.
Your description about the data after the * doesn't look like either
The second is something like
select right(col,len(col)-5)
from
(
select col = left(col,charindex('',col)-1) from tbl where charindex('',col) > 1
) a
create table #rocky(blob varchar(150));
insert into #rocky
select '20191250563622**TB' union
select '20192DSGN**DIPTS.'
;with oogly
as
(
select substring(left(blob,charindex('*',blob,0)-1),6, len(blob)) as slice_dice, blob
from #rocky
)
select case
when ISNUMERIC(slice_dice) = 0 then slice_dice
else left(slice_dice, 3)
end
from oogly
drop table #rocky