Wednesday, 8 March 2017

WAITFOR Command in Sql Server

The WAITFOR DELAY command will allow us to specify the amount of time that we would like to pass before continuing on with the code. We can specify the amount of time down to the milliseconds (’00:00:00:001′) if we need it more accurate. The WAITFOR DELAY command will allow you to specify the amount of time that you would like to pass before continuing on with the code. 

Syntax   


Example

Here I am using Wait for 10 seconds
select getdate() as [Before Time]
WAITFOR DELAY '00:00:10.000'
select getdate() as [After 10 Second Wait Time]

See the output

  

No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts