Click here to Skip to main content
14,427,436 members
Rate this:
Please Sign up or sign in to vote.
See more:
Greeting everyone

i'm new here and i'm looking for answer for my question
my idea is change value of row after certain time only once
i have column in my table content number which considered as minutes

if there's number on that column mean this row will be update after minutes on that column

and if there's no number on that column there's will be no change

the update will be only once on that row which content number (minutes)

how can i do that?

i'm using that for my c# project

What I have tried:

i really don't know how start that code because or where must be put it
Updated 4-Jan-20 23:36pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

If you need to do something in the database based on an interval, you cannot execute the code in a trigger since trigger is executed immediately upon the data manipulation.

Taken this is SQL Server, you can use SQL Server Agent - SQL Server Agent | Microsoft Docs[^] to execute code on a regular interval and update the rows you want.

If you're using SQL Server Express Edition, SQL agent is not available. In that case you could use for example SQL Agent: A Job Scheduler Framework[^]

You also probably need to add a column in your table to distinguish the records that have been updated from those not yet updated...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100