Today is discovered a command in T-SQL I never have used before: WAITFOR
This is not the most important command 🙂 But nice to if you need to wait for a predefined number of seconds or until a certain time of day in your scripts.
WAITFOR DELAY ’00:00:20′;
pauses code execution for 20 seconds
- WAITFOR TIME ’23:46:00′;
pauses execution to wait for a specific time
This command can be used to syncronize processes in a simple fashion from your scripts. These scripts often run from command line, scheduled tasks or similar applications.