有没有办法在Microsoft SQL Server Management工作室(SQL Server 2008 R2)中自动刷新查询结果?
目前我正在调试一个自动插入和更新数据库中的数据的应用程序,我想跟踪进度,而不必在F5键上存放重物.
Rac*_*erX 45
试试这个:
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
Run Code Online (Sandbox Code Playgroud)
它将运行查询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.
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
24654 次 |
最近记录: |