Solved

How to trigger a periodic control in a database

Posted on 2009-05-03
5
762 Views
Last Modified: 2012-05-06
Hi,

I have a table containing a field lastModificationTime, I want to do periodic controls over the records, say every 5 mins, in this field and if there has been more than 5 mins I want to update that record. I am using MS SQL Server 2008, how can I accomplish this?
0
Comment
Question by:guveniscan
  • 3
5 Comments
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24290363
you can use SQL Jobs.
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24290375
0
 

Author Comment

by:guveniscan
ID: 24294418
I'm sorry but the links you provided are not very clear to me. I want to update all the records in a table every 5 mins. Can you give a more clear explanation?
0
 
LVL 31

Accepted Solution

by:
RiteshShah earned 500 total points
ID: 24294471
suppose you want to update table like:

Update SalesTable set CurrentTime=GETDATE()

Above statement will update the SalesTable's CurrentTime field with current date and time. Now you can go to SQL Server Agent, create new job, set above update statement there, set timing every 5 minutes and you are done. see screen shot for more details.

BTW, above links were providing information about how to use SQL Agent.


job.JPG
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

806 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