Tuesday, November 06, 2007
It took me a while (more than 15 minutes!) to find something so elementary. The thing is how to call a sleep function in T-SQL in SS2005. The statement is: Waitfor Delay <DelayLength>, where <DelayLength> can be in the format: '00:00:10' for ten seconds. the <DelayLength> can be also a parameter of the type char(8).

Friday, January 04, 2008 3:47:40 AM (Jerusalem Standard Time, UTC+02:00)
Why sleep is even needed in T-SQL?
Can you give me an example for such usage?
Moshe Uphnik
Friday, March 28, 2008 11:10:58 PM (Jerusalem Daylight Time, UTC+03:00)
To extend the life of temporary global tables to allow other processes to get their data, for instance
Good Reason
Friday, April 04, 2008 5:56:59 AM (Jerusalem Daylight Time, UTC+03:00)
Thanks for posting this! It came in very handy.
Will
Tuesday, May 06, 2008 6:22:18 AM (Jerusalem Daylight Time, UTC+03:00)
There are a lot of reasons to use Sleep in T-SQL. For instance, look at my posts about connection Informatica and Analysis Services. When the Stored Procedure is processing the Cube/Dimension it loop and waits until the process is done and then sends its results back to the Informatica workflow.
Thursday, August 21, 2008 1:56:41 AM (Jerusalem Daylight Time, UTC+03:00)
Another use is for testing what happens in your application if your data access is slow and times out.
Dave
Thursday, September 17, 2009 3:02:15 AM (Jerusalem Daylight Time, UTC+03:00)
Thanks to you it only took me 20 seconds to find the answer to the same question.
MIke
All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (HTML not allowed)