Urgent Help Please

  • I have to keep track of change for one of the column in one of the tables..

    If the column gets updated then i need to Insert the updated column new value into another staging table.

    what are the options please help me..

    I can write a trigger ...saying After Update...Will the trigger fire and gets the records inserted into the staging table...even if i do a single update or bulk update or Batch Update...

    Please let me know any other options, that would be of great help....

  • Updtae tbl_xyz set Col1='sdfsdfsdf',

    Col2='12313'

    OUTPUT(DELETED.COl1,DELETED.Col2)

    INTO tbl_xyz_oldvalues (dltedCol1,dltedCol2)

    the following code is optional

    FRom tbl_xyz joins tbl_abc om aid=xid

    where col3='Guntur'

  • Lucky9 (5/19/2010)


    I have to keep track of change for one of the column in one of the tables..

    If the column gets updated then i need to Insert the updated column new value into another staging table.

    what are the options please help me..

    I can write a trigger ...saying After Update...Will the trigger fire and gets the records inserted into the staging table...even if i do a single update or bulk update or Batch Update...

    Please let me know any other options, that would be of great help....

    You can also write a trigger, updated(column_name) command will let you know whether the column has been updated or not. But trigger will work only once when you do bulk update that is for the 1sr row to over come it you need to do batch update i mean using loop, hope this helps you.

    Nag

    Nag
    ------------------------------------------------
    How to get the best help on a forum

    http://www.sqlservercentral.com/articles/Best+Practices/61537

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

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