在 Management Studio 中自动查看特定数据库

发布于 2025-01-03 18:58:27 字数 172 浏览 0 评论 0原文

我们有一个远程托管的 SQL 数据库,我使用 SQL Server Management Studio 来管理一切。由于我们位于共享服务器上,同一服务器上还有许多其他数据库。有没有办法在连接时自动将对象资源管理器扩展到我的数据库?或者可能过滤数据库以仅显示我的?

在连接属性中指定“连接到数据库”并不能实现此目的。

We have an SQL database that is hosted remotely and I use SQL Server Management Studio to manage everything. Being that we are on a shared server there are many other databases on the same server. Is there a way to automatically expand the object explorer to my database upon connection? or possibly filter the databases to show only mine?

Specifying the "Connect to database" in the Connection Properties does not achieve this.

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

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

发布评论

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

评论(2

丶视觉 2025-01-10 18:58:27

Management Studio 有一些命令行开关此处

exe 位于此处在我的电脑上:
“C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe”。

使用 -U 开关指定登录名,使用 -S 指定服务器,这将打开一个连接到该登录名默认数据库的新查询文件。这可以使用 alter 命令进行更改,即

alter login sa with default_database = master

这并不完全连接对象资源管理器,但它可能有助于您尝试执行的操作。

There are a few command line switches for Management Studio here

The exe is here on my PC:
"C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe".

Use the -U switch to specify a login and -S to specify a server and this will open a new query file connected to this logins default database. This can be changed using the alter command, i.e.

alter login sa with default_database = master

This isn't quite connecting Object Explorer but it may help with what you are trying to do.

×纯※雪 2025-01-10 18:58:27

在 SSMS 中,您现在可以过滤该列表。右键单击数据库“文件夹”并根据需要添加过滤器:

在此处输入图像描述

看起来您也可以过滤表、视图、过程和函数...但数据库将是最有用的,我怀疑。

In SSMS you can now filter that list. Right-click on the databases "folder" and add a filter as desired:

enter image description here

Looks like you can filter tables, views, procedures, and functions too...but databases will be the most useful one, I suspect.

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