How to replace text within a string using wild cards

  • Hi all,

    Is there a way to replace certain characters within a text field?

    For example,

    Data looks like this

    "XXX, ABC, DEF"

    "ABC, XXX, DEF"

    "ABC, DEF, XXX"

    "XXX"

    I like to replace the "XXX" with "YYY"

  • Am I missing something here, your post title says something about using wildcards?  Anyway, look up REPLACE in BOL. 

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • And if you truly need to use wild cards, look up PatIndex() and Stuff() in Books Online.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply