Hi @ahmed salah
Because there are three '|' in your string, which means the string will be splited into four values. If there are only two '|' like this: 'REACH Version|REACH Version|REACH'
it will be divided into three values.
Try this:
SELECT VALUE AS NULLflag
FROM #ChemicalConfilict P
CROSS APPLY STRING_SPLIT(Left(P.NULLflag,len(P.NULLflag)-1),'|')
SELECT p.NULLflag
FROM #ChemicalConfilict P
CROSS APPLY Z2DataCore.dbo.SplitString(Left(P.NULLflag,len(P.NULLflag)-1),'|')
Output:
Best regards,
LiHong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.