Example:
E9393_89df8_PRODUCT1_VARIATION4_COLOR6_iwantthis_20220101_STYLE54
E5464_7gf67_PRODUCT9_VARIATION65_COLOR16_iwantthistoo_20230109_STYLE50
E9875_grde67_PRODUCT13_VARIATION41_COLOR49_iwantthisaswell_20230113_STYLE64
i've tried charindex but can't figure out how to get what I need
E9393_89df8_PRODUCT1_VARIATION4_COLOR6_iwantthis_20220101_STYLE54
E5464_7gf67_PRODUCT9_VARIATION65_COLOR16_iwantthistoo_20230109_STYLE50
E9875_grde67_PRODUCT13_VARIATION41_COLOR49_iwantthisaswell_20230113_STYLE64
should turn into
iwantthis
iwantthistoo
iwantthisaswell
You can use a combination of
CHARINDEXandSUBSTRING. However, it gets messy as you have to pass the same truncated string on each search.Here it's an example of how to do it (each column contains the steps so you can see how it works)