I have a string:
@string='TEST RESULTS\TEST 1\RESULT 1
The string/text remains the same except for the numbers
- need the 1 from TEST
- need 1 from RESULT
to be used in a query like:
SET @sql = "SELECT *
FROM TABLE
WHERE test = (expression FOR CASE 1 resulting IN INT 1)
AND result = (expression FOR CASE 2 resulting IN INT 1)"
Since you have stable text and only 2 elements, you can make good use of replace and parsename:
The replace portion does assume the same text and spacing always, and sets up for parsename with the period.