在 ms sql server management studio 中自动刷新查询? [英] Automatically refresh a query in ms sql server management studio?

查看:47
本文介绍了在 ms sql server management studio 中自动刷新查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Microsoft SQL Server Management Studio (SQL Server 2008 R2) 中自动刷新查询结果?

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

目前我正在调试一个应用程序,它会自动在数据库中插入和更新数据,我想跟踪进度,而不必在 F5 键上放置重物.

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.

推荐答案

试试这个:

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 秒

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

输出:

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.

这篇关于在 ms sql server management studio 中自动刷新查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆