WAITFOR DELAY in SQL Server

If you want to pause the execution of the code block for a specific amount of time , you can try using the WAITFOR DELAY statement in SQL Server.

For example , you want to delay the execution say for example 5 seconds and then execute the query.

use AdventureWorks2014
GO
WAITFOR DELAY '0:0:5'
select * from HumanResources.Department
go


If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Reply


x

Interesting BlogPosts to read

Dealing with the column names that looks like SQL Keywords in SQL Server
There are times when you might have a column names in your SQL Server database table that might look...
SQL Server's ISNULL() equivalent in PostgreSQL
SQL Server provides an function ISNULL if the value placed in the 2nd parameter if the first paramet...
Kill all the current active connection in SQL Server database
There are times when you want to kill all the current active connections of your SQL Server database...