SQL Management Studio - 执行当前行

发布于 2024-08-29 01:21:17 字数 161 浏览 5 评论 0原文

在 SQL Server 2008 Management studio 中,我可以按 F5 来执行当前查询窗口中的所有内容。我还可以突出显示一个查询,然后按 F5 运行该突出显示的查询。

有没有办法可以运行光标所在的单个查询,或者运行光标所在的查询,直到第一个“;”,而不是必须突出显示查询?

In SQL Server 2008 Management studio, I can hit F5 to execute everything in the current query window. I can also highlight a query, and hit F5 to run that highlighted query.

Instead of having to highlight a query, is there a way I can run the single query my cursor is on, or run a query my cursor is on up to a the first ';'?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

墨落画卷 2024-09-05 01:21:17

在选项中,您可以配置要显示的行号,然后只需单击行号即可突出显示整行。

In options you can configure line numbers to be displayed, then you can just click on a line number, which will highlight the whole line.

泪之魂 2024-09-05 01:21:17

Unfortunately no there is no such keyboard shortcut in the MSDN list of keyboard shortcuts for SMSS, and I don't see any way of recording a macro to do so. The only solutions I've found require creating an add-in which is quite a bit of work for a little savings.

御守 2024-09-05 01:21:17

安装 SQL Complete Express。它是一个免费的 SSMS 插件(也是付费版本),它允许使用 CTRL+SHIFT+E 执行当前语句,我已将其重新映射到 F9,因为我也经常使用 Toad。

我尝试了其他几个,但它们要么无法与 SSMS 2012 配合使用,要么就是我无法使用它们。

我发现智能感知比内置版本更快。

Install SQL Complete Express. Its an SSMS plugin that free (also a paid version) and it allows using CTRL+SHIFT+E to execute current statement, I have remapped it to F9 as I use Toad frequently too.

I tried several others but they either didn't work with SSMS 2012 or I just didn't get on with them.

I find the intellisense quicker than the built in version to.

哆兒滾 2024-09-05 01:21:17

如果您能够使用 SSMS 2012,那么您可以使用 SSMS Executor 添加,如所述st-stoqnov他对类似问题的回答

Alpha 版本 还适用于 SSMS 2014/2016/2017。

If you are able to use SSMS 2012 then you can use the SSMS Executor add in as mentioned by st-stoqnov in his answer to a similar question.

An Alpha release is also available for SSMS 2014/2016/2017.

属性 2024-09-05 01:21:17

在 SQL 中,结束一条语句后,只要您的光标位于该行的末尾,您所要做的就是按 SHIFT+HOME,它将突出显示整个语句,然后您可以继续按f5....

In SQL after concluding a statement and as along as your cursor is at the end of the line all you have to do it hit SHIFT+HOME and it will highlight the entire statement and you can then proceed to press f5....

韬韬不绝 2024-09-05 01:21:17

对于键盘用户:

我发现将光标向下移动到查询行的末尾,或者如果该行为空,则向下移动到下面的行,然后使用“SHIFT + 向上箭头”选择完整的查询。选择后按 f5

For keyboard users:

I found going down with the cursor to the end of the query line, or the line bellow if it is empty, and then using "SHIFT + arrow up" to select the full query. After selection hit f5

奶气 2024-09-05 01:21:17

新的SQL Prompt有这个功能。您按SHIFT+F5,光标当前所在的语句将被执行。这可以节省大量时间,并且是从一开始就应该存在的功能。

The new SQL Prompt has this feature. You press SHIFT+F5 and the statement that your cursor is currently on will be executed. That's a big time saver and a feature that should have been there from the start in the first place.

只有影子陪我不离不弃 2024-09-05 01:21:17

我刚刚免费安装了Devart's Sql Complete Express。使用 ctrl-shift-e 即可完成您想要的操作。

现在我只需要交换,使 ctrl-e 执行当前和 ctrl-shift-e 一切......

I just installed Devart's Sql complete express that is free of charge. With ctrl-shift-e it does what you want.

Now I just need to swap, to make ctrl-e execute current and ctrl-shift-e everything...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文