Passing Values in triggers

  • hi everyone,

    i hv a problem,

    how can i pass parameters in a trigger 

    plz help me out

    thanx

     

  • I think there is misunderstanding about the trigger

    though trigger is a stored procedure you can not execute it manuallly. it gets executed when you try to do Insert or update or Delete operration on particular table.

    but you can make use of data which you have Inserted

    (you can make use of Inserted table in trigger)

    but can't pass any other parameter which is not a part of that particular table

  • yah,

    fine, but suppose i hv updated a column(col1) in a table(tab1)

    and there is a trigger which fires after updation so plz tell me how can i get the older col1 value and newer col1 value in this trigger

    kk

     

  • updation is nothing but deletion followed by insertion

    so you execute select col1 from deleted in trigger then you will get old value

    select col1 from inserted will give you new value

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

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