Saturday, January 3, 2009

SQL Server: WAITFOR DELAY Statement to set Delay in Queries

WAITFOR DELAY statement is used in T-SQL to set the delay time between the SQL queries. For example the second query will execute after 10 seconds of delay:

SELECT GETDATE() CurrentTime
WAITFOR DELAY ‘00:00:10′ —- 10 Second Delay
SELECT GETDATE() CurrentTime

No comments: