|
In addition to the JOB execution that everyone said, you can also use the following methods:
declare @Last_hour char(2)
select @Last_hour=convert(char(2),getdate(),108)
while 1=1 (loop execution, you can also decide whether to stop executing the process by accessing a certain global variable or a certain table parameter)
begin
waitfor DELAY '00:00:10'-wait for 10 seconds
update L set L=L+CAST(rand()*1000 as INT) FROM table. . (The rand()*1000 depends on the situation to define by yourself)
IF @Last_hour<>convert(char(2),getdate(),108) one hour passed
BGEIN
Generate a record to the table
select @Last_hour=convert(char(2),getdate(),108)
END
end
In this way, the tasks to be performed on the hour may differ by 0-10 seconds
However, you can also move the task to be performed on the whole point to another process for execution. The algorithm is similar, which can reduce the time error. |
|