Microsoft SQL Server Management Studio(SSMS)概述
介紹 (Introduction)
Microsoft SQL Server Server Management is an advanced development environment that enables us to configure, manage and administrate SQL Server database engines. SSMS is very popular and widely used by the database developers and administrators because of the following advantages:
Microsoft SQL Server服務器管理是一個高級開發環境,使我們能夠配置,管理和管理SQL Server數據庫引擎。 由于以下優點,SSMS受到數據庫開發人員和管理員的廣泛歡迎和廣泛使用:
- Cost-free
免費用
- Advanced user experience
先進的用戶體驗
- Various add-in options
各種加載項選項
- Easy installation
簡易安裝
Firstly, we will learn the installation and then go through the other details of the SSMS.
首先,我們將學習安裝方法,然后詳細介紹SSMS的其他細節。
安裝 (Installation)
We can download the latest version of the SSMS from the Microsoft download website and we can also find out the release notes.
我們可以從Microsoft下載網站下載最新版本的SSMS,也可以找到發行說明。
After downloading the setup file, we will open the setup file and click the install button in order to begin the installation. On this screen, the Location setting specifies the installation path of the Microsoft SQL Server Management Studio:
下載安裝文件后,我們將打開安裝文件并單擊安裝按鈕以開始安裝。 在此屏幕上,“ 位置”設置指定Microsoft SQL Server Management Studio的安裝路徑:
In the second screen, the installation process will be started and the progression of the setup will be shown:
在第二個屏幕中,將開始安裝過程,并顯示安裝進度:
After the installation is completed, the following screen will appear and inform us that the installation has been completed successfully:
安裝完成后,將出現以下屏幕,并通知我們安裝已成功完成:
Now, we can launch SSMS from the Start menu:
現在,我們可以從“ 開始”菜單啟動SSMS:
Also, we can use the Command Prompt to launch SSMS:
另外,我們可以使用命令提示符來啟動SSMS:
連接到數據庫引擎 (Connecting to the Database Engine)
When we launch the SSMS, the Connect to Server dialog screen will appear in front of us. In this screen, we will set the Server name and Authentication type of the SQL Server which we want to connect to and then click the Connect button. In the following illustration, we will connect to a SQL Express edition with the SQL Server Authentication type. If we click on the Remember password option, SSMS will remember our username and password for the next connection of the same SQL Server instance:
當我們啟動SSMS時,“ 連接到服務器”對話框屏幕將出現在我們前面。 在此屏幕中,我們將設置我們要連接SQL Server的服務器名稱和身份驗證類型 ,然后單擊“ 連接”按鈕。 在下圖中,我們將連接到具有SQL Server身份驗證類型SQL Express版本。 如果單擊“ 記住 密碼”選項,SSMS將為同一SQL Server實例的下一次連接記住我們的用戶名和密碼:
After a successful connection, the Object Explorer panel will appear on the left side of the main window of Microsoft SQL Server Management Studio.
成功連接后,“ 對象資源管理器”面板將出現在Microsoft SQL Server Management Studio主窗口的左側。
On the Object Explorer, we can change various settings of the SQL Server Engine and deployed databases. This screen provides us to accomplish database related operations such as the backup, restore, detach, etc.:
在對象資源管理器上 ,我們可以更改SQL Server Engine和已部署數據庫的各種設置。 此屏幕為我們提供了完成與數據庫相關的操作,例如備份,還原,分離等的操作:
At the same time, this screen helps us to maintain and manipulate the database objects.
同時,此屏幕可幫助我們維護和操作數據庫對象。
Tip: Object Explorer Details panel helps us to find out more details about the server and database objects which are located under the selected folder. By default, this panel will be invisible, but we can open it under the View menu:
提示:“對象資源管理器的詳細信息”面板可幫助我們找到有關位于所選文件夾下的服務器和數據庫對象的更多詳細信息。 默認情況下,該面板是不可見的,但是我們可以在“ 視圖”菜單下將其打開:
For example, if we want to obtain more details about the tables which are contained by a particular database, selecting the tables folder will be enough to see these details. In addition, we can also add different data to this tabular list according to the type of the object. For example, it allows seeing the record number of rows for the tables:
例如,如果我們要獲取有關特定數據庫所包含的表的更多詳細信息,則選擇表文件夾將足以查看這些詳細信息。 另外,我們還可以根據對象的類型將不同的數據添加到該列表中。 例如,它允許查看表的記錄行數:
Microsoft SQL Server Management Studio上的查詢編輯器 (Query Editor on Microsoft SQL Server Management Studio )
Another ability of the SSMS is that it enables to create and execute the T-SQL queries. When we click on the New Query button, which is placed on the toolbar, a new Query Editor will open. In this editor, we can create and execute SQL queries. In the following example, we will execute a very basic query that shows some of the synthetic customer data. First, we will open a new query editor window, type desired query and then, we will click the Execute button to run the query. The query result will be shown under the Results panel:
SSMS的另一個功能是,它可以創建和執行T-SQL查詢。 當我們單擊工具欄上的“ 新建查詢”按鈕時,將打開一個新的查詢編輯器 。 在此編輯器中,我們可以創建和執行SQL查詢。 在下面的示例中,我們將執行一個非常基本的查詢,其中顯示了一些綜合客戶數據。 首先,我們將打開一個新的查詢編輯器窗口,鍵入所需的查詢,然后單擊執行按鈕以運行查詢。 查詢結果將顯示在“ 結果”面板下:
SELECT *
FROM(VALUES
(1, 'Gertie Michener', 'London'
),
(2, 'Colton Guion', 'New York'
),
(3, 'Ahmed Coty', 'Berlin'
),
(4, 'Devin Kimmons', 'Istanbul'
)) CustomerTable(Id, CustomerName, City)
SSMS query editor offers various productivity options to programmers. In the previous example, the result set of the query has been shown on the grid, but we can change this option. On the SQL Editor toolbar, we can change this setting to Results to File, so that the result set of the query will be shown in a text format:
SSMS查詢編輯器為程序員提供了各種生產力選項。 在前面的示例中,查詢的結果集已顯示在網格上,但是我們可以更改此選項。 在SQL編輯器工具欄上,我們可以將此設置更改為Results to File ,以便查詢的結果集將以文本格式顯示:
When we want to separate the query window and result set window, we need to enable the Display results in a separate tab option. To enable this option we need to follow the below steps:
當我們想分開查詢窗口和結果集窗口時,我們需要啟用“ 在單獨的選項卡中顯示結果”選項。 要啟用此選項,我們需要執行以下步驟:
-
Click the Options command which is placed under the Tools menu:
單擊“ 工具”菜單下的“ 選項”命令:
-
Enable the Display results in a separate tab option under either Results to Grid tab or Results to Text tab:
在“ 結果到網格”選項卡或“ 結果到文本”選項卡下啟用“ 在單獨的選項卡中顯示結果”選項:
After enabling this option, the query results will be shown in a separate window. However, this option will be enabled when a new Query Window is opened. When we run the following query, the result set will be shown in the separate tab:
啟用此選項后,查詢結果將顯示在單獨的窗口中。 但是,當打開新的查詢窗口時,將啟用此選項。 當我們運行以下查詢時,結果集將顯示在單獨的選項卡中:
After the mentioned setting is changed, the query result will be shown as follows:
更改上述設置后,查詢結果將顯示如下:
The following illustration indicates the essential features of the SQL Editor toolbar:
下圖說明了SQL編輯器工具欄的基本功能:
- Available Databases: In this drop-down menu, we can determine a database on which the query will be executed可用的數據庫:在此下拉菜單中,我們可以確定要在其上執行查詢的數據庫
- Execute: This button starts the execution of a currently active query window執行:此按鈕開始執行當前活動的查詢窗口
- Cancel Executing Query: This button stops the execution of the query取消執行查詢:此按鈕停止執行查詢
- Parse: This button validates the syntax of the query, but does not check the database objects解析:此按鈕驗證查詢的語法,但不檢查數據庫對象
- Changing query result destination: In this button group, we can set the destination of the query result. It provides three different options: 更改查詢結果的目的地:在此按鈕組中,我們可以設置查詢結果的目的地。 它提供了三種不同的選項:
- Results to Grid
網格結果
- Results to Text
結果文本
- Results to File
結果存檔
- Results to Grid
-
Comment/Uncomment out the Selected Lines:
These buttons provide the option for commenting or uncommenting on the selected code lines: -
注釋/取消注釋選定的行:
這些 按鈕提供了對選定代碼行進行注釋或取消注釋的選項:
Tip: Some programmers wish to see the line numbers of the code in the query editor. Therefore, we need to follow the below steps:
提示:某些程序員希望在查詢編輯器中查看代碼的行號。 因此,我們需要遵循以下步驟:
- Options command, which is placed under the 選項”命令,該命令位于“ Tools menu 工具”菜單下
- General tab, which is placed under 常規”選項卡,該選項卡位于“ Transact-SQL node Transact-SQL”節點下
- Line numbers option 行號選項
After this setting change, the queries will be formatted as follows:
更改此設置后,查詢的格式將如下所示:
結論 (Conclusion)
In this article, we learned the basics of Microsoft SQL Server Management Studio and the following articles will help to improve SSMS-related skills :
在本文中,我們學習了Microsoft SQL Server Management Studio的基礎知識,并且以下文章將有助于提高與SSMS相關的技能:
- 10 SSMS Tips and Tricks to boost your Productivity 10個SSMS技巧和竅門可提高您的生產力
- Top free add-ins for SQL Server Management Studio (SSMS) SQL Server Management Studio(SSMS)的頂級免費加載項
- 10 SSMS Tips and Tricks to boost your Productivity 10個SSMS技巧和竅門可提高您的生產力
翻譯自: https://www.sqlshack.com/overview-of-microsoft-sql-server-management-studio-ssms/
總結
以上是生活随笔為你收集整理的Microsoft SQL Server Management Studio(SSMS)概述的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Quagga简介、安装、配置说明
- 下一篇: windows性能监控Perfmon