SQL Server Management Studio中的“收藏夹”或“宏”?

时间:2022-11-11 16:31:18

I have a few databases that I always use SQL Server Management Studio with. I'd like to be able to create a toolbar button or keyboard shortcut that automatically opens a new query window (in the current SSMS instance) and connects to a given (registered, perhaps) database. That's it. That's all I need. And this ashtray, and the paddle game, and the remote control. That's all I need.

我有一些数据库,我总是使用SQL Server Management Studio。我希望能够创建一个工具栏按钮或键盘快捷键,自动打开一个新的查询窗口(在当前的SSMS实例中)并连接到给定的(可能已注册)数据库。而已。这就是我所需要的一切。这个烟灰缸,桨游戏和遥控器。这就是我所需要的一切。

As it is now, I have to expand the Object Explorer, collapse/expand two to eight trees, right-click on my database, and choose "New Query". I see no way to do it, this would probably save me 30-60 seconds a day, which is worth at least one dollar and NINE CENTS.

就像现在一样,我必须展开对象资源管理器,折叠/展开两到八棵树,右键单击我的数据库,然后选择“新建查询”。我认为没办法做到这一点,这可能每天节省我30-60秒,这至少值1美元和NINE CENTS。

5 个解决方案

#1


9  

I am developer of SSMSBoost add-in and it has exactly what you need: is allows to manage the list of preferred servers/databases and quickly switch between them via custom Combobox on the toolbar, you can also say, if you want all servers to be opened in ObjectExplorer upon start-up and if a new query window should be opened for them (per-server setting).

我是SSMSBoost插件的开发者,它正是你需要的:它允许管理首选服务器/数据库列表,并通过工具栏上的自定义Combobox快速切换它们,你也可以说,如果你想要所有服务器在启动时在ObjectExplorer中打开,如果应为它们打开一个新的查询窗口(每服务器设置)。

SSMSBoost also allows you to define aliases (instead of server8273128 > MainServer, server231232> BackupServer etc..) It has more features - but they are out of scope of this topic.

SSMSBoost还允许您定义别名(而不是server8273128> MainServer,server231232> BackupServer等。)它具有更多功能 - 但它们超出了本主题的范围。

Look at the picture - you can see Quick Connection Switch combobox with some Servers from preferred connections, "SSMSBoostDemoServer" - is an alias for the server, next name - is original.

查看图片 - 您可以看到快速连接交换机组合框与来自首选连接的一些服务器,“SSMSBoostDemoServer” - 是服务器的别名,下一个名称 - 是原始的。

One more thing - add-in is available in free edition.

还有一件事 - 免费版提供加载项。

SQL Server Management Studio中的“收藏夹”或“宏”?

#2


2  

Have you tried creating a registered server?

您是否尝试过创建注册服务器?

Take a look at the "Registered Servers" view (Ctrl-Alt-G). Define a server connection. Set the password, and click the "Remember Password" checkbox if you're not using Windows Authentication. On the "Connection Properties" tab, set your preferred database. Save the server registration.

查看“已注册的服务器”视图(Ctrl-Alt-G)。定义服务器连接。设置密码,如果您不使用Windows身份验证,请单击“记住密码”复选框。在“连接属性”选项卡上,设置首选数据库。保存服务器注册。

Now, to connect to that database on that server (assuming you've got the Registered Server pane always visible, as I do), you just need to select that registration node and hit Ctrl-N.

现在,要连接到该服务器上的该数据库(假设您已经注册服务器窗格始终可见,就像我一样),您只需选择该注册节点并按Ctrl-N即可。

That should save you at least 43 seconds a day.

这应该每天至少节省43秒。

#3


2  

I haven't read through the whole thing yet, but this article is about creating an add-in for SSMS, which you might be able to do in order to automate what you want.

我还没有读过整篇文章,但是本文是关于为SSMS创建一个加载项,您可以这样做以自动化您想要的内容。

#4


1  

You could create a shortcut to launch SQL Server Management studio using command line parameters, as follows:

您可以使用命令行参数创建启动SQL Server Management studio的快捷方式,如下所示:

SQLWB.EXE - launches SQL Server Management Studio from the Command Prompt or Start -> Run text box. Through its switches, you can specify which type of server (-t S, -t A, or -t C for SQL Server, Analysis Server, or SQL Server Mobile Edition, respectively), server name (-S), and database (-d) you want to connect to, provide authentication information, or designate which queries, projects, or solutions to open (-i filename). The defaults (in absence of switches) are defined in the Tools -> Options menu of the SQL Server Management Studio.

SQLWB.EXE - 从命令提示符或开始 - >运行文本框启动SQL Server Management Studio。通过其开关,您可以指定哪种类型的服务器(分别为SQL Server,Analysis Server或SQL Server Mobile Edition为-t S,-t A或-t C),服务器名称(-S)和数据库( -d)您要连接,提供身份验证信息或指定要打开的查询,项目或解决方案(-i filename)。默认值(在没有开关的情况下)在SQL Server Management Studio的“工具” - >“选项”菜单中定义。

[Source]

[资源]

#5


1  

This solution is admittedly a hack, but if you can figure out the exact keystrokes needed to accomplish each 'macro', you can use a free tool like AutoHotKey to automate the keystrokes using whatever shortcuts you wish.

这个解决方案无疑是一个黑客,但如果你能找出完成每个'宏'所需的确切击键,你可以使用像AutoHotKey这样的免费工具,使用你想要的任何快捷方式自动完成击键。

#1


9  

I am developer of SSMSBoost add-in and it has exactly what you need: is allows to manage the list of preferred servers/databases and quickly switch between them via custom Combobox on the toolbar, you can also say, if you want all servers to be opened in ObjectExplorer upon start-up and if a new query window should be opened for them (per-server setting).

我是SSMSBoost插件的开发者,它正是你需要的:它允许管理首选服务器/数据库列表,并通过工具栏上的自定义Combobox快速切换它们,你也可以说,如果你想要所有服务器在启动时在ObjectExplorer中打开,如果应为它们打开一个新的查询窗口(每服务器设置)。

SSMSBoost also allows you to define aliases (instead of server8273128 > MainServer, server231232> BackupServer etc..) It has more features - but they are out of scope of this topic.

SSMSBoost还允许您定义别名(而不是server8273128> MainServer,server231232> BackupServer等。)它具有更多功能 - 但它们超出了本主题的范围。

Look at the picture - you can see Quick Connection Switch combobox with some Servers from preferred connections, "SSMSBoostDemoServer" - is an alias for the server, next name - is original.

查看图片 - 您可以看到快速连接交换机组合框与来自首选连接的一些服务器,“SSMSBoostDemoServer” - 是服务器的别名,下一个名称 - 是原始的。

One more thing - add-in is available in free edition.

还有一件事 - 免费版提供加载项。

SQL Server Management Studio中的“收藏夹”或“宏”?

#2


2  

Have you tried creating a registered server?

您是否尝试过创建注册服务器?

Take a look at the "Registered Servers" view (Ctrl-Alt-G). Define a server connection. Set the password, and click the "Remember Password" checkbox if you're not using Windows Authentication. On the "Connection Properties" tab, set your preferred database. Save the server registration.

查看“已注册的服务器”视图(Ctrl-Alt-G)。定义服务器连接。设置密码,如果您不使用Windows身份验证,请单击“记住密码”复选框。在“连接属性”选项卡上,设置首选数据库。保存服务器注册。

Now, to connect to that database on that server (assuming you've got the Registered Server pane always visible, as I do), you just need to select that registration node and hit Ctrl-N.

现在,要连接到该服务器上的该数据库(假设您已经注册服务器窗格始终可见,就像我一样),您只需选择该注册节点并按Ctrl-N即可。

That should save you at least 43 seconds a day.

这应该每天至少节省43秒。

#3


2  

I haven't read through the whole thing yet, but this article is about creating an add-in for SSMS, which you might be able to do in order to automate what you want.

我还没有读过整篇文章,但是本文是关于为SSMS创建一个加载项,您可以这样做以自动化您想要的内容。

#4


1  

You could create a shortcut to launch SQL Server Management studio using command line parameters, as follows:

您可以使用命令行参数创建启动SQL Server Management studio的快捷方式,如下所示:

SQLWB.EXE - launches SQL Server Management Studio from the Command Prompt or Start -> Run text box. Through its switches, you can specify which type of server (-t S, -t A, or -t C for SQL Server, Analysis Server, or SQL Server Mobile Edition, respectively), server name (-S), and database (-d) you want to connect to, provide authentication information, or designate which queries, projects, or solutions to open (-i filename). The defaults (in absence of switches) are defined in the Tools -> Options menu of the SQL Server Management Studio.

SQLWB.EXE - 从命令提示符或开始 - >运行文本框启动SQL Server Management Studio。通过其开关,您可以指定哪种类型的服务器(分别为SQL Server,Analysis Server或SQL Server Mobile Edition为-t S,-t A或-t C),服务器名称(-S)和数据库( -d)您要连接,提供身份验证信息或指定要打开的查询,项目或解决方案(-i filename)。默认值(在没有开关的情况下)在SQL Server Management Studio的“工具” - >“选项”菜单中定义。

[Source]

[资源]

#5


1  

This solution is admittedly a hack, but if you can figure out the exact keystrokes needed to accomplish each 'macro', you can use a free tool like AutoHotKey to automate the keystrokes using whatever shortcuts you wish.

这个解决方案无疑是一个黑客,但如果你能找出完成每个'宏'所需的确切击键,你可以使用像AutoHotKey这样的免费工具,使用你想要的任何快捷方式自动完成击键。