Welcome

首页 / 数据库 / SQLServer / Sql Server中如何让程序暂停几秒中再执行后面的命令

Sql Server中如何让程序暂停几秒中再执行后面的命令2015-02-12-- 语法

WAITFOR
{
   DELAY "time_to_pass"
 | TIME "time_to_execute"
 | [ ( receive_statement ) | ( get_conversation_group_statement ) ]
   [ , TIMEOUT timeout ]
}

注意:Delay最多不超过24小时

waitfor delay"00:00:10" -- 暂停10秒select GETDATE()WAITFOR TIME "23:00";-- 几点几分执行WAITFOR DELAY "01:00"; -- 1小时以后执行