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
Microsoft SQL Server 2008

Avatar of undefined
Last Comment
Anthony Perkins
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

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Microsoft SQL Server 2008
Microsoft SQL Server 2008

Microsoft SQL Server 2008 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. Major improvements include the Always On technologies and support for unstructured data types.

50K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo