Need to wait to execute a TSQL in SQL Server?
If you are running tests on a SQL Server database using scripts, usually you may have to create a batch of TSQL and they must be executed in a certain order and in a certain time, to achive this you can use the WAITFOR DELAY statament, it allows your script to wait N seconds before being executed. In the following script we wait 30 seconds before executing the getdate command.
WAITFOR DELAY '00:00:30' ---- 30 Seconds Delay
SELECT GETDATE() CurrentTime
Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP
Technorati Tags: SQL Server
LiveJournal Tags: SQL Server
del.icio.us Tags: SQL Server