This is a mirror of official site: http://jasper-net.blogspot.com/

Make a T-SQL Query Sleep for a certain amount of time

| Tuesday, September 7, 2010
At times, in test scenarios, you may want to emulate that a transaction or a T-SQL query takes ‘x’ amount of time. Well that is possible (although not with precision) in SQL Server (2005/2008) using the WAITFOR command.

Here’s an example of delaying query execution till a specified time interval has elapsed – let us say 10 seconds

USE Northwind
WAITFOR DELAY '00:00:10';
SELECT LASTNAME, FIRSTNAME FROM Employees;

Read more: SQL Server curry

Posted via email from .NET Info

0 comments: