Skip to content

Commit f59b506

Browse files
author
stevestein
committed
sqldb - update connect ssms article
1 parent a692b6f commit f59b506

File tree

1 file changed

+20
-33
lines changed

1 file changed

+20
-33
lines changed

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

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,31 @@ 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 use [SQL Server Management Studio][ssms-install-latest-84g] (SSMS) to connect to an Azure SQL database and run some sample 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+
- An AdventureWorksLT sample database. If you need a working copy of the AdventureWorksLT SQL database, create one by completing the steps in this article: [Quickstart: Create an Azure SQL database](sql-database-single-database-get-started.md).
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

@@ -56,22 +45,22 @@ In SMSS, connect to your Azure SQL Database server.
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.
5746
>
5847
59-
1. Open SSMS. The **Connect to Server** dialog box appears.
48+
1. Open SSMS.
6049

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

6352
| Setting     | Suggested value | Description |
6453
| ------------ | ------------------ | ----------- |
6554
| **Server type** | Database engine | Required value. |
66-
| **Server name** | The fully qualified server name | Something like: **mynewserver20170313.database.windows.net**. |
55+
| **Server name** | The fully qualified server name | Something like: **servername.database.windows.net**. |
6756
| **Authentication** | SQL Server Authentication | This tutorial uses SQL Authentication. |
6857
| **Login** | Server admin account user ID | The user ID from the server admin account used to create the server. |
6958
| **Password** | Server admin account password | The password from the server admin account used to create the server. |
7059
||||
7160

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

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.
63+
3. Select **Options** in the **Connect to Server** dialog box. In the **Connect to database** drop-down menu, select **mySampleDatabase**. If your working copy of the AdventureWorks database has a different database name, select it instead of **mySampleDatabase**.
7564

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

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

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

90-
2. In the query window, paste this SQL query.
79+
2. In the query window, paste the following SQL query:
9180

9281
```sql
9382
SELECT pc.Name as CategoryName, p.name as ProductName
@@ -96,11 +85,11 @@ Run this [SELECT](https://msdn.microsoft.com/library/ms189499.aspx) Transact-SQL
9685
ON pc.productcategoryid = p.productcategoryid;
9786
```
9887

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

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

103-
## Insert data
92+
### Insert data
10493

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

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

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

130-
## View the result
119+
#### View the result
131120

132121
1. Replace the previous query with this one.
133122

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

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

143-
## Update data
132+
### Update data
144133

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

@@ -154,7 +143,7 @@ Run this [UPDATE](https://msdn.microsoft.com/library/ms177523.aspx) Transact-SQL
154143

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

157-
## Delete data
146+
### Delete data
158147

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

@@ -179,6 +168,4 @@ Run this [DELETE](https://msdn.microsoft.com/library/ms189835.aspx) Transact-SQL
179168
- To connect and query using Python, see [Connect and query with Python](sql-database-connect-query-python.md).
180169
- To connect and query using Ruby, see [Connect and query with Ruby](sql-database-connect-query-ruby.md).
181170

182-
<!-- Article link references. -->
183171

184-
[ssms-install-latest-84g]: https://docs.microsoft.com/sql/ssms/sql-server-management-studio-ssms

0 commit comments

Comments
 (0)