Link to home
Start Free TrialLog in
Avatar of venkataramanaiahsr
venkataramanaiahsr

asked on

Triggering an update event on table column after specific time duration

I have database table column which needs to updated after specific duration. One way of doing this is create a job and schedule it after the specific duration .  is there any better way of doing this. To be specific can the same task be accomplished by a trigger which fires on the specified table column after specific duration

Request expert's help in this regard at the earliest.


DB is MS SQL 2008R2
Avatar of Surendra Nath
Surendra Nath
Flag of India image

the other way is to write a stored proceudre and put an infinite loop with the wait for dealy function..
the logic goes as below

step 1: Create a SP
step 2: create an end less loop
step 3: inside the loop put your update statement
step 4: put the wait for dealy statement inside the endless loop.

Now execute the stored procedure.

Drawbacks when compared to SQL Job:

1) if the session is killed, in which the SP is running then the stored procedure will be stopped and you have to re-execute it again.
ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial