有没有办法自动刷新 SQL Server Management Studio (SQL Server 2008 R2) 中的查询结果?
目前,我正在调试一个自动在数据库中插入和更新数据的应用程序,我希望跟踪进度,而无需在 F5 键上放置重物。
最佳答案
试试这个:
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
它将运行查询 5 次,每次运行之间暂停 10 秒
输出:
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.
关于sql-server - 自动刷新 SQL Server Management Studio 中的查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5434192/