How to use the REPLACE statement efficiently?

  • I have a POS database and I need to update the table: Inventory_TagAlongs

    The column TagAlong_ItemNum has two name I need to replace

    FS CRV- Under 24ozNT
    FS CRV- Under 24oz.
    WITH
    CRV- Under 24oz.

    This is probably super simple for the experts but I have failed all day, so I am asking for help.

    Thanks in advance.

    Would it be:
    UPDATE Inventory_TagAlongs
    REPLACE ?

    The Inventory_TagAlongs table  looks like:
    ItemNum           Store_ID   TagAlong_ItemNum     Quanity
    101200000759     1001       FS CRV- Under 24oz.  1.000

  • You'll need to update your column values.

    UPDATE Inventory_TagAlongs
    set TagAlong_ItemNum = 'CRV- Under 24oz'
    where TagAlong_ItemNum IN ('FS CRV- Under 24ozNT','FS CRV- Under 24oz')

    Important. This will update the actual row content. Use at your own risk.

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    This thing is addressing problems that dont exist. Its solution-ism at its worst. We are dumbing down machines that are inherently superior. - Gilfoyle

  • Henrico Bekker - Tuesday, March 7, 2017 9:14 PM

    You'll need to update your column values.

    UPDATE Inventory_TagAlongs
    set TagAlong_ItemNum = 'CRV- Under 24oz'
    where TagAlong_ItemNum IN ('FS CRV- Under 24ozNT','FS CRV- Under 24oz')

    Important. This will update the actual row content. Use at your own risk.

    I was attempting to make that WAYYYY harder than it was. I knew THAT code lol

    Thanks Mr. Bekker

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

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