Skip to content

Commit b6172d7

Browse files
authored
Merge pull request #107557 from stevestein/sqldb-connect-ssms
sqldb - update connect ssms article
2 parents d9376f4 + 7157d8e commit b6172d7

File tree

1 file changed

+23
-39
lines changed

1 file changed

+23
-39
lines changed

articles/sql-database/sql-database-connect-query-ssms.md

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,73 +11,61 @@ ms.topic: quickstart
1111
author: stevestein
1212
ms.author: sstein
1313
ms.reviewer:
14-
ms.date: 03/25/2019
14+
ms.date: 03/10/2020
1515
---
1616
# Quickstart: Use SQL Server Management Studio to connect and query an Azure SQL database
1717

18-
In this quickstart, you'll use [SQL Server Management Studio][ssms-install-latest-84g] (SSMS) to connect to an Azure SQL database. You'll then run Transact-SQL statements to query, insert, update, and delete data. You can use SSMS to manage any SQL infrastructure, from SQL Server to SQL Database for Microsoft Windows.
18+
In this quickstart, you'll learn how to use SQL Server Management Studio (SSMS) to connect to an Azure SQL database and run some queries.
1919

2020
## Prerequisites
2121

22-
An Azure SQL database. You can use one of these quickstarts to create and then configure a database in Azure SQL Database:
22+
Completing this quickstart requires the following items:
2323

24-
|| Single database | Managed instance |
25-
|:--- |:--- |:---|
26-
| Create| [Portal](sql-database-single-database-get-started.md) | [Portal](sql-database-managed-instance-get-started.md) |
27-
|| [CLI](scripts/sql-database-create-and-configure-database-cli.md) | [CLI](https://medium.com/azure-sqldb-managed-instance/working-with-sql-managed-instance-using-azure-cli-611795fe0b44) |
28-
|| [PowerShell](scripts/sql-database-create-and-configure-database-powershell.md) | [PowerShell](scripts/sql-database-create-configure-managed-instance-powershell.md) |
29-
| Configure | [Server-level IP firewall rule](sql-database-server-level-firewall-rule.md)| [Connectivity from a VM](sql-database-managed-instance-configure-vm.md)|
30-
|||[Connectivity from on-site](sql-database-managed-instance-configure-p2s.md)
31-
|Load data|Adventure Works loaded per quickstart|[Restore Wide World Importers](sql-database-managed-instance-get-started-restore.md)
32-
|||Restore or import Adventure Works from [BACPAC](sql-database-import.md) file from [GitHub](https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works)|
24+
- [SQL Server Management Studio (SSMS)](/sql/ssms/download-sql-server-management-studio-ssms/).
25+
- The AdventureWorksLT sample database. If you need a working copy of the AdventureWorksLT database, create one by completing the [Create an Azure SQL database](sql-database-single-database-get-started.md) quickstart.
26+
- The scripts in this article are written to use the AdventureWorksLT database. If you are using a managed instance, you must either import the AdventureWorks database into an instance database or modify the scripts in this article to use the Wide World Importers database.
3327

34-
> [!IMPORTANT]
35-
> The scripts in this article are written to use the Adventure Works database. With a managed instance, you must either import the Adventure Works database into an instance database or modify the scripts in this article to use the Wide World Importers database.
36-
37-
## Install the latest SSMS
38-
39-
Before you start, make sure you've installed the latest [SSMS][ssms-install-latest-84g].
28+
If you simply want to run some ad-hoc queries without installing SSMS, see [Quickstart: Use the Azure portal's query editor to query a SQL database](sql-database-connect-query-portal.md).
4029

4130
## Get SQL server connection information
4231

43-
Get the connection information you need to connect to the Azure SQL database. You'll need the fully qualified server name or host name, database name, and login information for the upcoming procedures.
32+
Get the connection information you need to connect to your database. You'll need the fully qualified server name or host name, database name, and login information to complete this quickstart.
4433

4534
1. Sign in to the [Azure portal](https://portal.azure.com/).
4635

47-
2. Navigate to the **SQL databases** or **SQL managed instances** page.
36+
2. Navigate to the **SQL database** or **SQL managed instance** you want to query.
4837

49-
3. On the **Overview** page, review the fully qualified server name next to **Server name** for a single database or the fully qualified server name next to **Host** for a managed instance. To copy the server name or host name, hover over it and select the **Copy** icon.
38+
3. On the **Overview** page, copy the fully qualified server name. It's next to **Server name** for a single database, or the fully qualified server name next to **Host** for a managed instance. The fully qualified name looks like: *servername.database.windows.net*, except it has your actual server name.
5039

5140
## Connect to your database
5241

53-
In SMSS, connect to your Azure SQL Database server.
42+
In SSMS, connect to your Azure SQL Database server.
5443

5544
> [!IMPORTANT]
5645
> An Azure SQL Database server listens on port 1433. To connect to a SQL Database server from behind a corporate firewall, the firewall must have this port open.
57-
>
5846
59-
1. Open SSMS. The **Connect to Server** dialog box appears.
47+
1. Open SSMS.
6048

61-
2. Enter the following information:
49+
2. The **Connect to Server** dialog box appears. Enter the following information:
6250

6351
| Setting     | Suggested value | Description |
6452
| ------------ | ------------------ | ----------- |
6553
| **Server type** | Database engine | Required value. |
66-
| **Server name** | The fully qualified server name | Something like: **mynewserver20170313.database.windows.net**. |
54+
| **Server name** | The fully qualified server name | Something like: **servername.database.windows.net**. |
6755
| **Authentication** | SQL Server Authentication | This tutorial uses SQL Authentication. |
6856
| **Login** | Server admin account user ID | The user ID from the server admin account used to create the server. |
6957
| **Password** | Server admin account password | The password from the server admin account used to create the server. |
7058
||||
7159

7260
![connect to server](./media/sql-database-connect-query-ssms/connect.png)
7361

74-
3. Select **Options** in the **Connect to Server** dialog box. In the **Connect to database** drop-down menu, select **mySampleDatabase**.If you leave the drop down to default, the connection is made to **master** database.
62+
3. Select **Options** in the **Connect to Server** dialog box. In the **Connect to database** drop-down menu, select **mySampleDatabase**. Completing the quickstart in the [Prerequisites section](#prerequisites) creates an AdventureWorksLT database named mySampleDatabase. If your working copy of the AdventureWorks database has a different name than mySampleDatabase, then select it instead.
7563

7664
![connect to db on server](./media/sql-database-connect-query-ssms/options-connect-to-db.png)
7765

7866
4. Select **Connect**. The Object Explorer window opens.
7967

80-
5. To view the database's objects, expand **Databases** and then expand **mySampleDatabase**.
68+
5. To view the database's objects, expand **Databases** and then expand your database node.
8169

8270
![mySampleDatabase objects](./media/sql-database-connect-query-ssms/connected.png)
8371

@@ -87,7 +75,7 @@ Run this [SELECT](https://msdn.microsoft.com/library/ms189499.aspx) Transact-SQL
8775

8876
1. In Object Explorer, right-click **mySampleDatabase** and select **New Query**. A new query window connected to your database opens.
8977

90-
2. In the query window, paste this SQL query.
78+
2. In the query window, paste the following SQL query:
9179

9280
```sql
9381
SELECT pc.Name as CategoryName, p.name as ProductName
@@ -96,11 +84,11 @@ Run this [SELECT](https://msdn.microsoft.com/library/ms189499.aspx) Transact-SQL
9684
ON pc.productcategoryid = p.productcategoryid;
9785
```
9886

99-
3. On the toolbar, select **Execute** to retrieve data from the `Product` and `ProductCategory` tables.
87+
3. On the toolbar, select **Execute** to run the query and retrieve data from the `Product` and `ProductCategory` tables.
10088

10189
![query to retrieve data from table Product and ProductCategory](./media/sql-database-connect-query-ssms/query2.png)
10290

103-
## Insert data
91+
### Insert data
10492

10593
Run this [INSERT](https://msdn.microsoft.com/library/ms174335.aspx) Transact-SQL code to create a new product in the `SalesLT.Product` table.
10694

@@ -127,7 +115,7 @@ Run this [INSERT](https://msdn.microsoft.com/library/ms174335.aspx) Transact-SQL
127115

128116
2. Select **Execute** to insert a new row in the `Product` table. The **Messages** pane displays **(1 row affected)**.
129117

130-
## View the result
118+
#### View the result
131119

132120
1. Replace the previous query with this one.
133121

@@ -140,11 +128,11 @@ Run this [INSERT](https://msdn.microsoft.com/library/ms174335.aspx) Transact-SQL
140128

141129
![result of Product table query](./media/sql-database-connect-query-ssms/result.png)
142130

143-
## Update data
131+
### Update data
144132

145133
Run this [UPDATE](https://msdn.microsoft.com/library/ms177523.aspx) Transact-SQL code to modify your new product.
146134

147-
1. Replace the previous query with this one.
135+
1. Replace the previous query with this one that returns the new record created previously:
148136

149137
```sql
150138
UPDATE [SalesLT].[Product]
@@ -154,7 +142,7 @@ Run this [UPDATE](https://msdn.microsoft.com/library/ms177523.aspx) Transact-SQL
154142

155143
2. Select **Execute** to update the specified row in the `Product` table. The **Messages** pane displays **(1 row affected)**.
156144

157-
## Delete data
145+
### Delete data
158146

159147
Run this [DELETE](https://msdn.microsoft.com/library/ms189835.aspx) Transact-SQL code to remove your new product.
160148

@@ -178,7 +166,3 @@ Run this [DELETE](https://msdn.microsoft.com/library/ms189835.aspx) Transact-SQL
178166
- To connect and query using Java, see [Connect and query with Java](sql-database-connect-query-java.md).
179167
- To connect and query using Python, see [Connect and query with Python](sql-database-connect-query-python.md).
180168
- To connect and query using Ruby, see [Connect and query with Ruby](sql-database-connect-query-ruby.md).
181-
182-
<!-- Article link references. -->
183-
184-
[ssms-install-latest-84g]: https://docs.microsoft.com/sql/ssms/sql-server-management-studio-ssms

0 commit comments

Comments
 (0)