关于sql server:如何停止正在运行的查询? 您所在的位置:网站首页 sql终止运行 关于sql server:如何停止正在运行的查询?

关于sql server:如何停止正在运行的查询?

2024-01-12 00:09| 来源: 网络整理| 查看: 265

我使用RODBC将查询发送到SQL Server。 有时它们需要太多时间来运行,因此我需要取消它们。

单击RStudio中的红色"停止"按钮会产生以下错误消息:

R is not responding to your request to interrupt processing so to stop the current operation you may need to terminate R entirely.

Terminating R will cause your R session to immediately abort. Active computations will be interrupted and unsaved source file changes and workspace objects will be discarded.

Do you want to terminate R now?

如果单击"是",则我的会话确实终止了。 (注意:使用Rgui代替RStudio不会使事情变得更好)

然而:

当我使用另一种软件(名为" Query ExPlus")连接到同一台SQL Server时,我有一个类似的停止按钮,单击它会立即中断查询,而不会导致崩溃。

当我使用RPostgres软件包连接到PostgreSQL数据库时,我也可以随时中断查询。

这两点使我认为应该有一种解决我的问题的方法。 我能做什么?

到目前为止,我的解决方法是:

1234library(RODBC) library(R.utils) withTimeout(mydf


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有