The SQL statement waitfor can be written to a stored procedure and executed again: waitfor {delay 'time' | time' time} the time after delay is the delay time after which the execution time is specified. The format is "HH: mm: SS ", the following is
See MSDN:Http://msdn.microsoft.com/zh-cn/library/ms187331.aspx
The syntax is:
{ [, TIMEOUT TIMEOUT]}
The following example executes a stored procedure at night 10:20 ( 22:20 ) sp_update_job .
Copy Code code as follows:
Use msdb;
Write an infinite loop sub-statement in T-SQL.Program
However, the sleep statement similar to C # cannot be found. Later, we can use the following waitfor statement to implement this function.
Code
Code highlighting produced by
Released on: 11/15/2004 | updated on: 11/15/2004
Itzik Ben-gan
This article is based on Beta 1 of Microsoft SQL Server code "Yukon". All the information contained here may be changed.
Download the code in this article: tsqlinyukon.exe
From: http://blog.csdn.net/missmecn/archive/2008/10/06/3019798.aspx related articles:
MySQL database lock
Several lock modes in Oracle
Recommendation circle:Pipboy More related recommendations
The Study of the lock mechanism requires two
NOLOCK (without lock)When this option is selected, SQL Server does not add any locks when reading or modifying data. In this case, it is possible for the user to read the data in the incomplete transaction (uncommited Transaction) or rollback (roll
Understanding Transactions and LocksTransactions: The essential tool for maintaining logical data consistency and recoverability.Lock: When multiple users access the same database resource, a mechanism for the priority authority management of access,
Understanding Transactions and LocksTransactions: The essential tool for maintaining logical data consistency and recoverability.Lock: When multiple users access the same database resource, a mechanism for the priority authority management of access,
Server
Why should I introduce a lock?
Concurrent operations on a database by multiple users can cause the following data inconsistencies:
Missing updatesA,b two users read the same data and make changes, one of the user's changes to destroy the
In two or more SQL server processes, a deadlock occurs when each process locks the resources that other processes attempt to lock. For example,The process process1 holds one exclusive lock (x) for Table1, and process1 requests one exclusive lock (x)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.