Solved

Triggering an update event on table column after specific time duration

Posted on 2013-12-21
2
381 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

     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 …
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now