Solved

How to trigger a periodic control in a database

Posted on 2009-05-03
5
765 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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Creating and Managing Databases with phpMyAdmin in cPanel.
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…

856 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