查询编辑器窗口的 SSMS 更改连接 [英] SSMS Change Connection for Query Editor Window

查看:28
本文介绍了查询编辑器窗口的 SSMS 更改连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通常,当我想在 SQL Server Management Studio 中更改查询编辑器窗口的连接时,我可以从顶部的菜单中选择一个新连接 - 查询 > 连接 > 更改连接.

Normally when I want to change the connection for a Query Editor Window in SQL Server Management Studio, I can select a new connection from the menus at the top - Query > Connection > Change Connection.

但是,当我使用分析服务连接处理多维数据集时 - 然后打开保存的 SQL 脚本(例如底层 SQL 视图),可用数据库组合框为空白,更改连接"和其他 3 个选项位于该菜单(连接、断开连接、断开所有查询)都变灰了.

However, when I am working on cubes with an analysis services connection - and then open a saved SQL script (such as the underlying SQL view) the Available Databases combobox is blank, and the "Change Connection" and other 3 options in that menu (Connect, Disconnect, Disconnect all queries) are all greyed out.

我发现能够运行保存的 SQL 脚本的唯一解决方法是从我想在对象资源管理器中访问的 SQL 数据库中打开一个新查询",然后将我的脚本复制到其中,或者重新打开脚本 - 现在正常打开,带有新查询的数据库.

The only workaround I have found to be able to run the saved SQL script, is to open a "New Query" from the SQL Database I want to access in the Object Explorer, and either copy my script into it, or reopen the script - which now opens as normal, with the new query's database.

似乎将最后一个查询编辑器窗口的数据库连接作为任何新查询的默认连接 - 当您的最后一个查询"正在浏览多维数据集时,它会中断吗?有没有人可以修复正确地取消更改连接"选项的灰色?

It seems to be taking the last Query Editor Window's database connection as the default connection for any new queries - and when your last "query" is browsing a cube then it breaks? Does anyone have a fix to un-grey out the "Change Connection" option properly?

我使用的是 SQL Server 2008 R2,并通过 File > Open > File 菜单打开保存的 SQL 脚本

I am using SQL Server 2008 R2, and opening the saved SQL script by the File > Open > File menu

推荐答案

好吧,SSMS 不允许轻松管理连接(尤其是当您想在服务器之间切换连接时).我为 SSMS 开发了插件:SSMSBoost - 它使用您最喜欢的连接(您必须定义它们)向工具栏添加额外的组合框.在您的情况下,打开脚本后,您必须从这个新的组合框中选择正确的连接,它将被建立.插件目前是免费的.

Well, SSMS does not allow to manage connections easily (particulary, when you want to switch connections between servers). I have developed add-in for SSMS: SSMSBoost - it adds additional combobox to the toolbar with your favorite connections (you have to define them). In your case, after opening the script you will have to pick the right connection from this new combobox and it will be established. Addin is currently free.

这篇关于查询编辑器窗口的 SSMS 更改连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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