Solved

Triggering an update event on table column after specific time duration

Posted on 2013-12-21
2
387 Views
Last Modified: 2014-01-01
I have database table column which needs to updated after specific duration. One way of doing this is create a job and schedule it after the specific duration .  is there any better way of doing this. To be specific can the same task be accomplished by a trigger which fires on the specified table column after specific duration

Request expert's help in this regard at the earliest.


DB is MS SQL 2008R2
0
Comment
Question by:venkataramanaiahsr
[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
2 Comments
 
LVL 16

Expert Comment

by:Surendra Nath
ID: 39733998
the other way is to write a stored proceudre and put an infinite loop with the wait for dealy function..
the logic goes as below

step 1: Create a SP
step 2: create an end less loop
step 3: inside the loop put your update statement
step 4: put the wait for dealy statement inside the endless loop.

Now execute the stored procedure.

Drawbacks when compared to SQL Job:

1) if the session is killed, in which the SP is running then the stored procedure will be stopped and you have to re-execute it again.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 39734139
No, you cannot use a TRIGGER for a time event.  The best option is to create a job to run as frequently as you wish.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
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.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

734 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