Create a DELAY for a specific amount of time
USE NORTHWIND
WAITFOR DELAY '00:01:00'
BEGIN
SELECT CustomerID, CompanyName, ContactName FROM CUSTOMERS
END
Delays the execution of the T-Sql statement by 1 minute. To delay by an hour, you would use '01:00:00'. You can specify a maximum of 24 hours.
Execute at the given time (actual time)
USE NORTHWIND
WAITFOR TIME '11:23:00'
BEGIN
SELECT CustomerID, CompanyName, ContactName FROM CUSTOMERS
END
Delays the execution of the T-Sql statement till the time '11:23 A.M'. You cannot specify a date, only time is allowed.
Did you like this post?
|
|
|
||
|
|
|
|
|
|
|
subscribe via rss |
|
subscribe via e-mail |
|
|
print this post |
|
follow me on twitter |




comments
1 Response to "Execute a T-SQL statement at a given time"Nice tutorial. You can find more about SQL queries at
SQL Query Question Answers
Post a Comment