with main as
(
select code from (
select 'S1056 S1020' as Code
union
select 'S1200 S1210 W010 T835'
union
select 'S1056'
union
select 'S1200 X1020'
) main
)
select code,
case when _2nd.s10 >0 Or _2nd.s12 > 0
then 'Multiple'
end
from main
cross apply
(
select PATINDEX('%s10%', Code)
, PATINDEX('%s12%', Code)
) _1st(s10, s12)
cross apply
(
select CASE WHEN _1st.s10 > 0
THEN PATINDEX('%s10%', substring(code,_1st.s10 + 3, len(code)))
END
, CASE WHEN _1st.s12 > 0
THEN PATINDEX('%s12%', substring(code,_1st.s12 + 3, LEN(code)))
END
) _2nd(s10, s12)
Assuming that S10 and S12 together should not match, what about the code below instead. The extra space is just to make sure that the match is only to the leading part of the value, that is, that is somehow a value such as "0s101" go in there, it would not cause a false match.
select code,
case when ' ' + Code like '% s10% s10%' Or
' ' + Code like '% s12% s12%' then 'Muliple'
else null end as code_flag
from main