sql-server - 自动刷新 SQL Server Management Studio 中的查询?

标签 sql-server ssms

有没有办法自动刷新 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/

相关文章:

sql-server-2012 - SQL Server Management Studio 无法启动 - 找不到类型库

sql-server-2008-r2 - SQL Server 2008 R2 Express : Management Tools Missing from Feature Selection

sql-server - SQL 日期查询 : Is 'not equal' more expensive than 'less than'

sql - 使用SQL查询获取在多个部门工作的员 worker 数

sql-server - 使用输出关键字获取SQL Server中最后插入的记录?

sql-server - 当表不存在时,如何解决“"Table ' dbo.Foo'已经存在。”错误?

sql - 查询在 ssms 中有效,但在 ssrs 中无效

sql-server - 在SQL Server中设计条件数据库关系

sql - 为什么 SQL Server 不使用我的索引? (过滤连接的索引 View )

sql-server - 为什么选择查询需要 IX 锁?