Rerunnble update Script

  • Hi Here is my update script and

    i want to make a rerunnable you can say dynamically run the script

    UPDATE c

    SET ContentMessage = REPLACE(ContentMessage, 'Chase is a debt collector.','') from ContentMessage as c INNER JOIN ContentFilter as cf

    ON c.ContentFilterId=cf.ContentFilterId INNER JOIN ContentType as ct

    ON cf.ContentTypeId=ct.ContentTypeId JOIN SubscriptionType s

    ON s.SubscriptionName=cf.SubscriptionName AND s.SubscriptionName IN ('home_pymt_prob') AND ct.ContentType IN ('Push','SMSText','AlertsHistory')

    can you please tell how i modified this script to rerunnable so if someone run this script then they able to run multiple time in same database.

    or if i need to check that this column is already modified then it will not fail to run.

    Thank you in advance.

  • What do you want to make "dynamic" in the script?

    --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)

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

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