SSMS
 sql >> Database >  >> Database Tools >> SSMS

Aggiornare automaticamente una query in ms sql server management studio?

prova questo:

SELECT GETDATE()              --your query to run
raiserror('',0,1) with nowait --to flush the buffer
waitfor delay '00:00:10'      --pause for 10 seconds
GO 5                          --loop 5 times

eseguirà la query 5 volte, fermandosi per 10 secondi tra ogni esecuzione

uscita:

Beginning execution loop

-----------------------
2011-03-25 11:03:57.640

(1 row(s) affected)


-----------------------
2011-03-25 11:04:07.640

(1 row(s) affected)


-----------------------
2011-03-25 11:04:17.640

(1 row(s) affected)


-----------------------
2011-03-25 11:04:27.640

(1 row(s) affected)


-----------------------
2011-03-25 11:04:37.640

(1 row(s) affected)

Batch execution completed 5 times.