SQL Server Management Studio教程–配置环境

In my earlier tutorial, I explained how to install SQL Server Management Studio in few easy steps. In this tutorial, I shall demonstrate the configuration of SQL Server Management Studio to reap the best of it as well as to make the work quite simple. In addition, I will walk you through the multiple settings of SQL Server Management Studio configuration, which can help you build a conducive environment and prevent frequent configurations. You will also learn the best / most efficient way to find the right feature at the right place at the right time, because this is one of the biggest challenges for a newbie.

在之前的教程中,我通过几个简单的步骤说明了如何安装SQL Server Management Studio。 在本教程中,我将演示SQL Server Management Studio的配置,以充分利用它并简化工作。 此外,我将引导您完成SQL Server Management Studio配置的多个设置,这些设置可以帮助您建立一个有利的环境并防止频繁的配置。 您还将学习最好/最有效的方法,以便在正确的时间在正确的位置找到正确的功能,因为这是新手面临的最大挑战之一。

Let me demonstrate how to configure SQL Server Management Studio (SSMS) in seven easy steps.

让我通过七个简单的步骤演示如何配置SQL Server Management Studio(SSMS)。

步骤1 –打开SQL Server配置管理器: (Step 1 – Open SQL Server Configuration Manager:)

Go to Start >> All Programs >> Microsoft SQL Server 2012 >> Configuration Tools >> SQL Server Configuration Manager. SQL Server Configuration Manager is a user friendly tool to manage the services related to SQL Server.

转到开始>>所有程序>> Microsoft SQL Server 2012 >>配置工具>> SQL Server配置管理器 。 SQL Server配置管理器是一种用户友好的工具,用于管理与SQL Server相关的服务。

SQL Server Management Studio教程–配置环境

步骤2 –启动SQL Server服务: (Step 2 – Start SQL Server Service:)

Once you are inside SQL Server Configuration Manager tool, you can see a lot of services in multiple states (start, pause, running). In this step, check if SQL Server service is running or not. If not, start this service by selecting the service, right click and start. Ensure service status has been changed to Start mode.

进入SQL Server配置管理器工具之后,您会看到许多处于多种状态(启动,暂停,运行)的服务。 在此步骤中,检查SQL Server服务是否正在运行。 如果没有,请通过选择服务来启动该服务,右键单击并启动。 确保服务状态已更改为“ 启动”模式。

SQL Server Management Studio教程–配置环境

步骤3 –启动SQL Server Management Studio: (Step 3 – Start SQL Server Management Studio:)

Open SQL Server Management Studio. Again select Start >> All Programs >> Microsoft SQL Server 2012 >> SQL Server Management Studio.

打开SQL Server Management Studio。 再次选择开始>>所有程序>> Microsoft SQL Server 2012 >> SQL Server Management Studio

SQL Server Management Studio教程–配置环境

步骤4 –提供凭证: (Step 4 – Provide Credentials:)

Provide the credential of SQL Server which you intend to connect. If you would like to connect locally installed SQL server, you can place a dot instead of Server name and it will connect to that server. However, for the best practice you must enter the Server name, Login & password for SQL Server Authentication. But, in case of windows authentication, you DO NOT need login and password details, however you need to give sufficient access rights to windows login to connect to SQL Server. Just click on Connect.

提供您要连接SQL Server的凭据。 如果要连接本地安装SQL Server,可以放置一个而不是Server name ,它将连接到该服务器。 但是,为了获得最佳实践,您必须输入SQL Server身份验证的服务器名称,登录名和密码。 但是,在Windows身份验证的情况下,你不需要用户名和密码的详细信息,但是你需要给足够的访问权限的Windows登录连接到SQL Server。 只需单击“ 连接”

SQL Server Management Studio教程–配置环境

步骤5 –设定环境: (Step 5 – Setup Environment:)

Once you login the SQL Server you can see the default environment of the SQL Server Management Studio. You can see Object explorer on the left hand side (LHS ) of the SQL Server Management Studio and on your right hand side (RHS), a blank area that we usually use for SQL query. This can be kept as a default option, but I recommend that you to go through the below startup options and select the one which best fits your environment. As I explained earlier, 1st option is the default one. However, I usually configure 3rd option in order to avoid opening of a new query window each time when connecting to SQL Server Management Studio. It automatically opens object explorer along with new query window.

登录SQL Server后,您可以看到SQL Server Management Studio的默认环境。 您可以在SQL Server Management Studio的左侧(LHS)和右侧(RHS)看到对象资源管理器,这是我们通常用于SQL查询的空白区域。 可以将其保留为默认选项,但是我建议您浏览以下启动选项,然后选择最适合您的环境的启动选项。 正如我之前解释的, 第一个选项是默认选项 。 但是,我通常配置第三个选项 ,以避免每次连接到SQL Server Management Studio时都打开新的查询窗口。 它会自动打开对象资源管理器以及新的查询窗口。

  1. Open Object Explorer (This is the default option)

    打开对象资源管理器( 这是默认选项
  2. Open New Query Window

    打开新查询窗口
  3. Open Object Explorer and new query (Recommended)

    打开对象资源管理器和新查询( 推荐
  4. Open Object Explorer and Activity Monitor

    打开对象资源管理器和活动监视器
  5. Open Empty Environment

    开放空环境

SQL Server Management Studio教程–配置环境

To achieve it, you need to select tools from the menu and further select options….. Once you select options, it pops up the options window, where you can configure lots of SQL Server Configuration that can make your SQL Server activities easier.

为此,您需要从菜单中选择工具 ,然后进一步选择选项 ……。选择选项后 ,它会弹出选项窗口 ,您可以在其中配置许多SQL Server配置,从而使您SQL Server活动更加轻松。

Let’s select startup option from the left hand side pane in the option windows & select Open Object Explorer and query window from the right hand drop down as shown below and Press OK.

让我们从选项窗口的左侧窗格中选择启动选项, 从右侧下拉菜单中选择“ 打开对象资源管理器和查询”窗口 ,如下所示,然后按OK。

SQL Server Management Studio教程–配置环境

Next time when you open SQL Server Management Studio, it will not only open Object explorer but also open a blank query window.

下次打开SQL Server Management Studio时,它不仅会打开“对象资源管理器”,还会打开一个空白的查询窗口。

步骤6 –设定视窗位置: (Step 6 – Setup Window Position:)

In this step, let’s review the window position button of any window in SQL Server and its options. This option is available in almost all Microsoft IDE (Integrated Development Environment), for example Visual Studio. Basically window position button allows you to set the position of any windows by providing below options. Please note that it is very important to set the position of these windows especially when working on multiple query windows and running short of space.

在此步骤中,让我们查看SQL Server中任何窗口的窗口位置按钮及其选项。 在几乎所有的Microsoft IDE(集成开发环境)中,例如Visual Studio,都可以使用此选项。 基本上,窗口位置按钮允许您通过提供以下选项来设置任何窗口的位置。 请注意,设置这些窗口的位置非常重要,尤其是在使用多个查询窗口且空间不足时。

  • Float

    浮动
  • Dock

    码头
  • Dock

    码头
  • Auto Hide

    自动隐藏
  • Hide

    隐藏

Note: If you set it up incorrectly and you want to restore it on default option, you do not need to put much effort, just select Window menu, click Reset Window Layout.

注意:如果您设置不正确,并且想要将其还原为默认选项,则无需花费太多精力,只需选择“ 窗口”菜单,然后单击“ 重置窗口布局”

SQL Server Management Studio教程–配置环境

第7步-设置键盘设置: (Step 7 – Setup Keyboard Settings:)

In this step, let’s discuss the Keyboard Shortcut Scheme & Query shortcut of SQL Server Management Studio. If you are a frequent user of visual Studio 2010 then I recommend that you set the Shortcut scheme to Visual Studio 2010 compatibility. Once setup, you will use the Visual Studio shortcut schema instead of the standard SQL Server Management Studio Shortcut. In order to do it, you need to select tools menu and options….. It will open options window. Once you are in the options window select Environment >> Keyboard >> Keyboard on the left hand pane and select Visual studio 2010 compatibility in the additional keyboard mapping schema on the right hand side.

在此步骤中,让我们讨论SQL Server Management Studio的键盘快捷方式和查询快捷方式。 如果您经常使用Visual Studio 2010,则建议您将“快捷方式”方案设置为与Visual Studio 2010兼容。 设置完成后,您将使用Visual Studio快捷方式架构,而不是标准SQL Server Management Studio快捷方式。 为此,您需要选择工具菜单选项 ...。它将打开选项窗口。 进入选项窗口后 ,在左侧窗格中选择环境>>键盘>>键盘 ,然后在右侧的其他键盘映射架构中选择Visual Studio 2010兼容性。

SQL Server Management Studio教程–配置环境

In addition to that you can also setup the query shortcuts in the same window. For that, you just need to select Environment >> Keyboard >> Query Shortcuts. In this window you can find few built-in shortcuts. However, you can define your own shortcuts to expedite your SQL work quickly. Please note that if you configure it incorrectly, you can restore to default at anytime by clicking Restore to Default button.

除此之外,您还可以在同一窗口中设置查询快捷方式。 为此,您只需选择环境>>键盘>>查询快捷方式 。 在此窗口中,您可以找到一些内置的快捷方式。 但是,您可以定义自己的快捷方式以加快您SQL工作。 请注意,如果配置不正确,可以随时单击“还原为默认值”按钮将其还原为默认值

SQL Server Management Studio教程–配置环境

结论: (Conclusion:)

I explained SQL Server Management Studio in few easy steps and focused on core configurations. However there are a lot of configurations that I could not cover in this tutorial but you can adjust those settings as per your requirement and can make your work much more efficient and easier.

我通过几个简单的步骤介绍了SQL Server Management Studio,并重点介绍了核心配置。 但是,在本教程中我无法涵盖很多配置,但是您可以根据需要调整这些设置,并使您的工作更加高效和轻松。

翻译自: https://www.sqlshack.com/sql-server-management-studio-tutorial-configuring-environment/