• SQL_NuB (3/4/2015)


    Jeff Moden (3/4/2015)


    What's wrong with just doing a replacement?

    UPDATE tgt

    SET Family = REPLACE(Family,'--','')

    FROM dbo.yourtable

    WHERE Family LIKE '%--%'

    ;

    there are other apps using the tables that I'm pulling from, so we can't do an update. It crossed my mind, but can't.

    Ah, crud. I totally misread the original post. My apologies.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)