Executing procedures after a time delay

The waitfor command delays execution of a stored procedure until a specified time or until a specified amount of time has passed.

For example, to execute the procedure testproc in half an hour:

begin
    waitfor delay "0:30:00"
    exec testproc
end

After issuing the waitfor command, you cannot use that connection to Adaptive Server until the specified time or event occurs.