shashikant singh

shashikant singh

  • NA
  • 6
  • 17.5k

Write a Trigger for update a column in sql server

Nov 16 2012 6:32 AM

I have 102 sp which modified(insert)  a particuler table , but I add A new column DurationInMinutes(bigint) in that table. and these column is updated according Status means it hold timestamps(difference) between two status for example---

new record inserttime is(in first status)  11:30 for a  work_orderid
and second status just like work in progress time is  11:46   for above  work_orderid

then this column hold value in First Status time is bydefault =0
and in second statust this column hold value is =16  , according to work_orderid

   So without changes sp , I want to write a trigger for update those column(DurationInMinutes).

  Please give me a sample of trigger for do this type of work..........