Monday, February 1, 2010

WAITFOR statement

WAITFOR statement is used to pause the execution of code to a specific time.


WAITFOR has three different options:

1. WAITFOR DELAY pauses the execution of code for a specified length of time

2. WAITFOR TIME pauses the execution of code until a specified time is reached

3. WAITFOR RECEIVE is used with Service broker


Let's see this example which shows how to use WAITFOR DELAY:



And this example shows how to use WAITFOR TIME:


No comments: