Automatically refresh a query in ms sql server management studio?

前端 未结 2 994
我在风中等你
我在风中等你 2020-12-30 22:03

Is there a way to automatically refresh the result of a query in the Microsoft SQL Server Management studio (SQL Server 2008 R2)?

Currently i\'m debugging an applica

2条回答
  •  感情败类
    2020-12-30 22:41

    try this:

    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
    

    it will run the query 5 times, pausing for 10 seconds between each run

    output:

    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.
    

提交回复
热议问题