How to know which column updated

  • Hi,

    I have one Customer Table which contains more than 25 columns.

    When user Updated any column in customer table.

    Example: if he is updated Address,City. or

    If he is updated Address , City , Country , ZipCode

    I want the Updated Column value will be inserterd into another table .

    Please help me.

    Thanks,

  • Please try trigger for that particular table.

    tr_TableName_After_Insert

    create trigger [dbo].[tr_TableName_After_Insert]

    on [dbo].[TableName]

    after insert

    as

    begin

    (your operation to insert into different table)

    end

  • Thanks for your reply.

    But i want when the user updating any fileds in the table , only those fileds i need to insert into another table.

    So i can know only these fileds are updated in that table.

    Thanks,

  • suresh0534 (11/28/2012)


    Thanks for your reply.

    But i want when the user updating any fileds in the table , only those fileds i need to insert into another table.

    So i can know only these fileds are updated in that table.

    Thanks,

    What does the original customer table and destination tables look like?

    --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 4 posts - 1 through 3 (of 3 total)

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