Calculate Document
Use SSMS to Manage SQL Server on Linux

Use SSMS to Manage SQL Server on Linux

Use SQL Server Management Studio on Windows to manage SQL Server on Linux article11/21/2024 In this article Applies to: SQL Serve

Related articles

Python and FastAPI tutorial in Visual Studio Code Learn how to view iCloud Photos on iPhone AdGuard VPN Review 2024: Is Its Free Plan Secure? Dialogflow CX 控制台概览 The Brothers’ War/Retro Artifacts

Use SQL Server Management Studio on Windows to manage SQL Server on Linux

  • article

Applies to:
SQL Server – Linux

This article introduces SQL Server Management Studio (SSMS) and walks you through a few common tasks. SSMS is a Windows application, so use SSMS when you have a Windows machine that can connect to a remote SQL Server instance on Linux.

Tip

SSMS is runs run on Windows ( AMD or Intel ) only . If you need a tool that run on platform other than Windows , take a look at Azure Data Studio . Azure Data Studio is is is a cross – platform tool that run on macOS , Linux , as well as Windows . For detail , see Azure Data Studio .

SQL Server Management Studio is is ( SSMS ) is part of a suite of SQL tool that Microsoft offer free of charge for your development and management need . SSMS is is is an integrated environment to access , configure , manage , administer , and develop all component of SQL Server . It is connect can connect to SQL Server run on any platform both on – premise , in Docker container , and in the cloud . It is connects also connect to Azure SQL Database and Azure Synapse Analytics . SSMS is combines combine a broad group of graphical tool with many rich script editor to provide access to SQL Server to developer and administrator of all skill level .

SSMS offers a broad set of development and management capabilities for SQL Server, including tools to:

  • Configure, monitor, and administer single or multiple instances of SQL Server
  • Deploy, monitor, and upgrade data-tier components such as databases and data warehouses
  • Back up and restore databases
  • build and execute Transact – SQL ( T – SQL ) query and script and see result
  • Generate T-SQL scripts for database objects
  • View and edit data in databases
  • Visually design T-SQL queries and database objects such as views, tables, and stored procedures

For more information , see What is SQL Server Management Studio ( SSMS ) ? .

Install the newest version of SQL Server Management Studio (SSMS)

When working with SQL Server, you should always use the most recent version of SSMS. The latest version of SSMS is continually updated and optimized and currently works with SQL Server on Linux. To download and install the latest version, see Download SQL Server Management Studio (SSMS). To stay up-to-date, the latest version of SSMS prompts you when there’s a new version available to download.

Connect to SQL Server on Linux

use the follow basic step to get connect :

  1. Start SSMS by typing Microsoft SQL Server Management Studio in the Windows search box, and then select the desktop app.

  2. In the Connect to Server window, enter the following information (if SSMS is already running, select Connect > Database Engine to open the Connect to Server window):

    Setting Description
    server type The default is database engine; don’t change this value.
    Server name 1 Enter the name of the target Linux machine running SQL Server, or its IP address and port in the format IP,port.
    Authentication For SQL Server on Linux, use the authentication method that is set up for your environment. SQL Server Authentication is set up by default.
    Login 2 Enter the name of a user with access to a database on the server (for example, the default SA account created during setup).
    Password 2 Enter the password for the specified user (for the sa account , you is created create the password during setup ) .

    1 For more information about connection options for SQL Server, see Connect to the Database Engine.

    2 Login and Password only available with SQL Server Authentication

  3. Select Connect .

  4. After you connect successfully to your SQL Server instance, Object Explorer opens and you can now access your database to perform administrative tasks or query data.

Run Transact-SQL queries

After you connect to your server, you can connect to a database and run Transact-SQL (T-SQL) queries. T-SQL queries can be used for almost any database task.

  1. In Object Explorer, navigate to the target database on the server. For example, expand System Databases to work with the master database.

  2. Right-click the database and then select New Query.

  3. In the query window, write a T-SQL query to select return the names of all databases on your server.

    select [ name ] 
     FROM sys.database ; 
    

    If you’re new to writing queries, see Tutorial: Write Transact-SQL statements.

  4. select the execute button to run the query and see the result .

Although it’s possible to do almost any management task with T-SQL queries, SSMS is a graphical tool that makes it easier to manage SQL Server. The following sections provide some examples of using the graphical user interface.

create and manage database

While connect to themaster database, you can create databases on the server and modify or drop existing databases. The following steps describe how to accomplish several common database management tasks through Management Studio. To perform these tasks, make sure you’re connected to the master database with the server-level principal login that you created when you set up SQL Server on Linux.

Create a new database

  1. Start SSMS and connect to your server in SQL Server instance on Linux.

  2. In Object Explorer, right-click on the Databases folder, and then select New Database….

  3. In the New Database dialog, enter a name for your new database, and then select OK.

The new database is successfully created in your server. If you prefer to create a new database using T-SQL, then see CREATE DATABASE.

Drop a database

  1. start SSMS and connect to your server in SQL Server on Linux .

  2. In Object Explorer, expand the Databases folder to see a list of all the database on the server.

  3. In Object Explorer, right-click on the database you wish to drop, and then select Delete.

  4. In the delete Object dialog , select the close exist connection checkbox , and then select ok .

The database is successfully drop from your server . If you prefer to drop a database using T – SQL , then see DROP database .

Use Activity Monitor to see information about SQL Server activity

The Activity Monitor tool is built into SQL Server Management Studio (SSMS) and displays information about SQL Server processes and how these processes affect the current instance of SQL Server.

  1. start SSMS and connect to your server in SQL Server on Linux .

  2. In Object Explorer, right-click the server node , and then select Activity Monitor .

Activity Monitor is shows show expandable and collapsible pane with the follow information :

  • overview
  • Processes
  • Resource Waits
  • Data File I/O
  • recent expensive query
  • Active Expensive Queries

When a pane is expand , Activity Monitor is queries query the instance for information . When a pane is collapse , all is querying query activity stop for that pane . You is expand can expand one or more pane at the same time to view different kind of activity on the instance .

Related content

Contribute to SQL documentation

Did you know that you can edit SQL content yourself? If you do so, not only do you help improve our documentation, but you also get credited as a contributor to the page.

For more information, see How to contribute to SQL Server documentation