0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【SQLServer】SQLで指定時間待機(Sleep)させる

Posted at

ストアド内で時間がかかる処理を再現したい。

C#でいうThread.Sleep処理のような、指定時間の間ブロックさせたい時は「WAITFOR」が使えます。

  • 指定時間の間待機させたい時は:WAITFOR DELAY
  • 指定時間まで待機させたい時は:WAITFOR TIME
-- 30秒待機したいとき
WAITFOR DELAY '00:00:30';

-- 12時まで待機したいとき
WAITFOR TIME '12:00:00';
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?