Solved

How to trigger a periodic control in a database

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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
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…

757 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

22 Experts available now in Live!

Get 1:1 Help Now