Geeks With Blogs
Nagendra Prasad
If you have two queries and you have to execute one after another with some amount of delay, then that is possible in SQL Server.

Lets say, your first query fills up the table with some records. Lets assume that, you will get some responses based on this records which will fill other table. Now your second query should run based on the responses table. Then you can make a delay for quite amount of time.

Lets see a simple example of using waitfor and delay in SQL Server:

Syntax:


WAITFOR DELAY 'HH:MM:SS'

where HH:MM:SS - Hours, minutes and seconds respectively.

Example:

SELECT GETDATE() CurrentTime
WAITFOR DELAY '00:00:05'
SELECT GETDATE() CurrentTime

Output:

CurrentTime
2009-03-25 14:47:13.797
CurrentTime
2009-03-25 14:47:18.800 Posted on Wednesday, March 25, 2009 2:50 PM | Back to top


Comments on this post: Wait/Delay in SQL Server

# re: Wait/Delay in SQL Server
Requesting Gravatar...
Thanks Nagendra
Left by Bhanwar on May 17, 2010 7:32 AM

# re: Wait/Delay in SQL Server
Requesting Gravatar...
Proprio mentre viagra senza ricetta stavo per firmare su comprar la mia adv TDI. Nitrox Acquistare Steve Lewis, istruttore generico nuovo nome Dan MacKay ha inserito nella lista vecchio Techdiver canadese che era l'istruttore GUE comprar Canada così mi ha spinto a Kingston per fare un cialis 20 Acquistare lui e cominciò Tech 1 il fine settimana successivo.
Il beautry di esso è che comprare viagra ora l'informazione è disponibile e non c'è più un motivo comprar cialis generico nuovo di navigare la curva di apprendimento sia attraverso acquisti sicuri o inefficiente inutile. Ma ci sono thosae di voi là fuori che insistono sulla sottoscrizione nuoto contro il flusso.
Left by sumin on Mar 14, 2011 7:52 AM

# re: Wait/Delay in SQL Server
Requesting Gravatar...
Wait/Delay - is not the best solution!
Left by sulit on Apr 16, 2011 1:00 AM

Your comment:
 (will show your gravatar)
 


Copyright © nagendraprasad | Powered by: GeeksWithBlogs.net | Join free