有没有办法为 MS SQL Server Management Studio 设置数据库的快捷方式

Phi*_*ent 5 shortcut ssms

我想要一个我的数据库服务器列表(我是一名开发人员),我目前有一个我连接到的不同机器的 RDP 文件列表。SQL Server Management Studio 中是否有类似的功能可以帮助我直接转到我需要去的地方,而不必等待登录屏幕弹出并询问我想要哪个服务器?

bob*_*rob 7

是的,您可以使用以下命令:

ssms.exe -S SERVERNAME -d DATABASENAME -E
Run Code Online (Sandbox Code Playgroud)

您可以使用 run 运行它,也可以将其放入 .txt 文件并将扩展名更改为 .bat 并运行它。

通过运行 smss.exe /? 可以找到更多信息:

Usage:
ssms.exe [-S server_name[\instance_name]] [-d database] [-U user] [-P password] [-E] [file_name[, file_name]] [/?]

    [-S The name of the SQL Server instance to which to connect]
    [-d The name of the SQL Server database to which to connect]
    [-E]    Use Windows Authentication to login to SQL Server
    [-U The name of the SQL Server login with which to connect]
    [-P The password associated with the login]
    [file_name[, file_name]] names of files to load
    [-nosplash] Supress splash screen
    [/?]    Displays this usage information
Run Code Online (Sandbox Code Playgroud)

  • 还值得指出的是,您不需要将其作为 .BAT/.CMD 文件 - 您只需创建一个新的 SSMS.exe 快捷方式(如果您愿意,可以复制“开始”菜单中的快捷方式)。调出新快捷方式的属性并将您的参数添加到“目标”文本框的末尾。 (3认同)