Right, so I am trying to write a REGEX function. Trying to write it as sort of a stored procedure, I guess (assuming that if that is the right way to go about it)?
Problem : I have a table with millions of rows. I would like to create a REGEX function that scrapes out the 6 alpha numeric CML code (mentioned in the table). Sometimes, it does not even mention the word CML and the code is still there. See Row 5 for reference below
My approach
SELECT *
FROM [Reporting].[dbo].[Master]
WHERE [Notes] LIKE '[C][M][L]%'
I am not too sure if that is the right way to go about it or not.
Desired result : I want to be able to write a code using a REGEX function which can look for such patterns in the notes column and put it as a separate column against its respective Part ID
This is the table:
Edit - A typo at my end occurred for L987234. The length of these characters is also 6, hence, it actually is L98723