Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically refresh a query in ms sql server management studio?

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 application which automatically inserts and updates data in a database and I'd like to track the progress without having to deposit a heavy object on the F5 key.

like image 332
grimmig Avatar asked Mar 25 '11 14:03

grimmig


People also ask

How do I refresh Microsoft SQL Server Management Studio?

With your focus in the Query window, press Ctrl+Shift+R. This will refresh your cache and now your query will be happy with you.

How do you refresh data in SQL?

Reloading involves creating an empty database file and using the reload. sql file to create the schema and insert all the data unloaded from another SQL Anywhere database into the newly created tables. You can reload databases from the command line.


1 Answers

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. 
like image 92
RacerX Avatar answered Sep 22 '22 23:09

RacerX