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




Ing. Eduardo Castro Martínez, PhD – Microsoft SQL Server MVP

Costa Rica

Technorati Tags: SQL Server

LiveJournal Tags: SQL Server Tags: SQL Server


Popular posts from this blog

Desactivar llaves foráneas en SQL Server

Permitiendo la administración de los jobs a usuarios que no son System Administrators en SQL Server Agent 2005 o superior

Configurar SQL Server y MSDTC