Use to block execution. While executing a WAITFOR statement the transaction is running and no other requests can run under the same transaction. Bear in mind that if the server is busy the thread may not be immediately scheduled.

----Delay for 20 seconds
WAITFOR DELAY '000:00:20'
SELECT '20 Second Delay'
----Delay till 7 AM
WAITFOR TIME '7:00:00'
SELECT 'Good Morning'


Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.


Your email address will not be published.