I need to find a numeric value + quotes within a string (example 5″). Once found, I need to replace the quote with “pound”. Unfortunately, the string is complex:
Sample string
Work and run with Joe "The King" Mel using a 3" vest with "Dog-Bone" weights.
I have tried
SELECT REPLACE(REPLACE('Work and run with Joe "The King" Mel using a 3" vest with "Dog-Bone" weights.', '%[^0-9]"%', 'pound'), '"', 'pound')
But it replaces all the quotes with ‘pound’.
This will find the first occurrence of a number followed by a
"and replace"withpound.STUFF
PATINDEX
If you have more than one you can put it in a while loop.