Solved

Triggering an update event on table column after specific time duration

Posted on 2013-12-21
2
384 Views
Last Modified: 2014-01-01
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
0
Comment
Question by:venkataramanaiahsr
2 Comments
 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39733998
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.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 39734139
No, you cannot use a TRIGGER for a time event.  The best option is to create a job to run as frequently as you wish.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

     When we have to pass multiple rows of data to SQL Server, the developers either have to send one row at a time or come up with other workarounds to meet requirements like using XML to pass data, which is complex and tedious to use. There is a …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question