WAITFOR Statement

Specifies a time, time interval, or event that triggers execution of a statement block, stored procedure, or transaction.

Syntax

WAITFOR {DELAY 'time' | TIME 'time'}

where

DELAY
Instructs SQL Server to wait until the specified amount of time has passed, up to a maximum of 24 hours.
TIME
Instructs SQL Server to wait until the specified time.
time
Specifies a time in one of the acceptable formats for datetime data. The time you specify can include hours, minutes, and seconds. Use the format 'hh:mm:ss'. You cannot specify dates ¾ the date portion of the datetime value is not allowed. You can also specify a local variable in place of the 'time' string. For details, see the Datatypes topic.

Remarks

After executing the WAITFOR statement, you cannot use your connection to SQL Server until the time or event that you specified occurs.

To see the active and waiting processes, use the sp_who system stored procedure.