Solved

How to trigger a periodic control in a database

Posted on 2009-05-03
5
781 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 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

691 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