SQL Server Management Studio 元件和設定SQL Server Management Studio components and configuration

本教學課程介紹 SQL Server Management Studio (SSMS) 中的各種視窗元件,以及工作區中的一些基本設定選項。This tutorial describes the various window components in SQL Server Management Studio (SSMS), and some basic configuration options for your workspace. 在此文章中,您將學會如何:In this article, you learn how to:

  • 識別組成 SSMS 環境的元件Identify the components that make up the SSMS environment
  • 變更環境配置,並將它重設為預設值Change the environment layout, and reset it to the default
  • 將查詢編輯器最大化Maximize the query editor
  • 變更字型Change the font
  • 設定啟動選項Configure startup options
  • 將設定重設為預設值Reset the configuration to the default

PrerequisitesPrerequisites

若要完成本教學課程,您需要 SQL Server Management Studio。To complete this tutorial, you need SQL Server Management Studio.

SQL Server Management Studio 元件SQL Server Management Studio components

本節描述工作區中可用的各種視窗元件,以及如何使用它們。This section describes the various window components that are available in the workspace, and how to use them.

  • 若要關閉視窗,請選取標題列右上角的 XTo close a window, select the X in the right corner of the title bar.

  • 若要重新開啟視窗,請選取 [檢視] 功能表中的視窗。To reopen a window, select the window in the View menu.

    [檢視] 功能表

  • 物件總管 (F8):物件總管是含有伺服器中所有資料庫物件的樹狀檢視。Object Explorer (F8): Object Explorer is a tree view of all the database objects in a server. 該檢視包含 SQL Server 資料庫引擎、SQL Server Analysis Services、SQL Server Reporting Services 和 SQL Server Integration Services 的資料庫。This view includes the databases of the SQL Server Database Engine, SQL Server Analysis Services, SQL Server Reporting Services, and SQL Server Integration Services. [物件總管] 含有它所連線之所有伺服器的資訊。Object Explorer includes information for all servers that are connected to it.

    物件總管

  • 查詢視窗 (Ctrl+N):選取 [新增查詢] 之後,在這個視窗中輸入 Transact-SQL (T-SQL) 查詢。Query Window (Ctrl+N): After you select New Query, enter your Transact-SQL (T-SQL) queries in this window. 此處也會顯示您的查詢結果。The results of your queries also appear here.

    新增查詢視窗

  • 屬性 (F4):查詢視窗開啟時,您會看到 [屬性] 檢視。Properties (F4): You can see the Properties view when the Query Window is open. 該檢視會顯示查詢的基本屬性。The view displays basic properties of the query. 例如,會顯示查詢開始的時間、傳回的資料列數目和連線詳細資料。For example, it shows the time that a query started, the number of rows returned, and connection details.

    屬性

  • 範本瀏覽器 (Ctrl+Alt+T):[範本瀏覽器] 具有各種預先建立的 T-SQL 範本。Template Browser (Ctrl+Alt+T): Template Browser has various pre-built T-SQL templates. 您可以使用這些範本來執行各種功能,例如建立或備份資料庫。You can use these templates to perform various functions, such as creating or backing up a database.

    範本瀏覽器

  • 物件總管詳細資料 (F7):此檢視會比使用 [物件總管] 中的檢視更精細。Object Explorer Details (F7): This view is more granular than the view in Object Explorer. 您可以使用 [物件總管詳細資料],同時管理多個物件。You can use Object Explorer Details to manipulate multiple objects at the same time. 例如,在這個視窗中,您可以選取多個資料庫,然後同時加以刪除或編寫其指令碼。For example, in this window, you can select multiple databases, and then either delete them or script them out simultaneously.

    物件總管詳細資料

變更環境配置Change the environment layout

本節描述如何變更環境配置,例如如何移動各種視窗。This section describes how to change the environment layout, such as how to move various windows.

  • 若要移動視窗,請按住標題,然後拖曳視窗。To move a window, press and hold the title, and then drag the window.

  • 若要釘選或取消釘選視窗,請選取標題列中的圖釘圖示:To pin or unpin a window, select the pushpin icon in the title bar:

    釘選物件

  • 每個視窗元件都具有您可以用各種方式操作視窗的下拉式功能表:Each window component has a drop-down menu that you can use to manipulate the window in various ways:

    視窗選項

  • 當您有兩個或更多個開啟的查詢視窗時,可以垂直或水平使視窗成為索引標籤,讓兩個查詢視窗均為可見。When two or more query windows are open, the windows can be tabbed vertically or horizontally so that both query windows are visible. 若要檢視索引標籤式視窗,請在查詢的標題上按一下滑鼠右鍵,然後選取您想要的索引標籤式選項:To view tabbed windows, right-click the title of the query, and then select the tabbed option that you want:

    查詢索引標籤選項

    • 以下是水平索引標籤群組:Here's a Horizontal Tab Group:

      水平索引標籤群組的範例

    • 以下是垂直索引標籤群組:Here's a Vertical Tab Group:

      垂直索引標籤群組的範例

    • 若要合併索引標籤,請以滑鼠右鍵按一下查詢標題,然後選取 [移至上一個索引標籤群組] 或 [移至下一個索引標籤群組] :To merge the tabs, right-click the query title, and then select Move to Previous Tab Group or Move to Next Tab Group:

      合併查詢索引標籤

  • 若要還原預設環境配置,請在 [視窗] 功能表中選取 [重設視窗配置] :To restore the default environment layout, in the Window menu, select Reset Window Layout:

    還原視窗配置

將查詢編輯器最大化Maximize Query Editor

您可以將查詢編輯器最大化為全螢幕模式:You can maximize Query Editor to full-screen mode:

  1. 按一下 [查詢編輯器] 視窗中的任何位置。Click anywhere in the Query Editor window.

  2. 按 Shift+Alt+Enter 鍵來切換全螢幕模式和一般模式。Press Shift+Alt+Enter to toggle between full-screen mode and regular mode.

這個鍵盤快速鍵適用於任何文件視窗。This keyboard shortcut works with any document window.

變更基本設定Change basic settings

本節描述如何從 [工具] 功能表中修改 SSMS 的某些基本設定。This section describes how to modify some basic settings in SSMS from the Tools menu.

工具功能表

  • 若要修改反白顯示的工具列,請選取 [工具] > [自訂] :To modify the highlighted toolbar, select Tools > Customize:

    自訂工具列

變更字型Change the font

  • 若要變更字型,請選取 [工具] > [選項] > [字型和色彩] :To change the font, select Tools > Options > Fonts and Colors:

    變更字型和色彩

變更啟動選項Change startup options

  • 啟動選項會決定您首次開啟 SSMS 時的工作區外觀。Startup options determine what your workspace looks like when you first open SSMS. 若要變更啟動選項,請選取 [工具] > [選項] > [啟動] :To change startup options, select Tools > Options > Startup:

    變更啟動選項

將設定重設為預設值Reset settings to the default

  • 您可以從功能表中匯出並匯入所有的這些設定。You can export and import all these settings from the menu. 若要匯入或匯出設定,或還原預設設定,請選取 [工具] > [匯入和匯出設定] To import or export settings, or to restore default settings, select Tools > Import and Export Settings

    匯入和匯出設定

後續步驟Next steps

熟悉 SSMS 的最佳方式是實際練習。The best way to get acquainted with SSMS is through hands-on practice. 這些「教學課程」 與「操作方式」 文章可協助您使用 SSMS 內所提供的各種功能。These tutorial and how-to articles help you with various features available within SSMS. 這些文章會告訴您如何管理 SSMS 的元件及如何尋找您經常使用的功能。These articles teach you how to manage the components of SSMS and how to find the features that you use regularly.