Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to trigger a periodic control in a database

Posted on 2009-05-03
5
Medium Priority
?
794 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article, we’ll look at how to deploy ProxySQL.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

618 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