Sleep Command in T-SQL?

后端 未结 4 614
情话喂你
情话喂你 2020-12-04 05:44

Is there to way write a T-SQL command to just make it sleep for a period of time? I am writing a web service asynchronously and I want to be able to run some tests to see i

4条回答
  •  不思量自难忘°
    2020-12-04 06:19

    Look at the WAITFOR command.

    E.g.

    -- wait for 1 minute
    WAITFOR DELAY '00:01'
    
    -- wait for 1 second
    WAITFOR DELAY '00:00:01'
    

    This command allows you a high degree of precision but is only accurate within 10ms - 16ms on a typical machine as it relies on GetTickCount. So, for example, the call WAITFOR DELAY '00:00:00:001' is likely to result in no wait at all.

提交回复
热议问题