Search code examples
regexwildcardssmsssms-2012

How to use find and replace wildcards in SSMS?


So I have something like:

Price1
Price2
Price3

And I'd like to do a Find and Replace on them so the end result is this:

COALESCE(Price1, 0)
COALESCE(Price2, 0)
COALESCE(Price3, 0)

I tried using this:

Find what: Price.
Replace with: coalesce(Price., 0)

The result is:

COALESCE(Price.,0)

I've gone into Find Options and checked "Use: Regular Expressions".

What did I do wrong?


Solution

  • Replace Coalesce(Price.,0) with Coalesce(\0,0) and you'll be good to go.