The problem is we have many different error messages being produced and stored in a sql table
within the error message there could be an occurance of a project number 8 characters long
which would contain at least 1 number is alphanumeric and no spaces. per error message the project number may not be the same.
e.g.
'error found processing project: abcd12sf no funding is set'
'error found processing project: qd451srf no funding is set'
'error project 2344ddrf has no approver'
We want to be able to count the occurances of particular errors and so we need to strip the project number from the output
thus
'error found processing project: no funding is set' , 2 occurances
'error project has no approver' , 1 occurance
Any help is greatly appreciated
Start by creating a Function that returns the project number. I did this by finding the first integer and then position of the space after it, then counting back 8 characters you have the start and end position.
Alter your table to have a computed column called ProjectNumber here is the create I did for testing but you should get the idea.
Now you have the project number in a separate column it is easy to play with.