You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/sql-database/sql-database-connect-query-portal.md
+35-39Lines changed: 35 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,80 +11,76 @@ ms.topic: quickstart
11
11
author: Ninarn
12
12
ms.author: ninarn
13
13
ms.reviewer: carlrab
14
-
ms.date: 10/24/2019
14
+
ms.date: 03/05/2020
15
15
---
16
-
# Quickstart: Use the Azure portal's SQL query editor to connect and query data
16
+
# Quickstart: Use the Azure portal's SQL Database Query Editor to query a SQL database
17
17
18
-
The SQL query editor is an Azure portal browser tool providing an easy way to execute SQL queries on your Azure SQL Database or Azure SQL Data Warehouse. In this quickstart, you'll use the query editor to connect to a SQL database and then run Transact-SQL statements to query, insert, update, and delete data.
18
+
The query editor is a tool in the Azure portal for executing SQL queries against your Azure SQL Database or Azure SQL Data Warehouse. In this quickstart, you'll use the query editor to run Transact-SQL (T-SQL) statements to query, insert, update, and delete data.
19
19
20
20
## Prerequisites
21
21
22
22
To complete this tutorial, you need:
23
23
24
-
-An Azure SQL database. You can use one of these quickstarts to create and then configure a database in Azure SQL Database:
24
+
-The AdventureWorksLT sample SQL Database. If you don't have the AdventureWorksLT SQL Database, use one of the following quickstarts to quickly create it:
| Configure |[Server-level IP firewall rule](sql-database-server-level-firewall-rule.md)|
32
31
|||
33
32
34
33
> [!NOTE]
35
34
> The query editor uses ports 443 and 1443 to communicate. Please ensure you have enabled outbound HTTPS traffic on these ports. You will also need to add your outbound IP address to the server's allowed firewall rules to access your databases and data warehouses.
36
35
37
-
## Sign in the Azure portal
36
+
## Open the SQL Database Query Editor
38
37
39
-
Sign in to the [Azure portal](https://portal.azure.com/).
38
+
1.Sign in to the [Azure portal](https://portal.azure.com/) and select your SQL database.
40
39
41
-
## Connect using SQL authentication
40
+
2. In the **SQL database** menu, select **Query editor (preview)**.
42
41
43
-
1. Go to the Azure portal to connect to a SQL database. Search for and select **SQL databases**.

46
44
47
-
2. Select your SQL database.
48
45
49
-

46
+
## Connect using SQL Authentication
50
47
51
-
3. In the **SQL database**menu, select **Query editor (preview)**.
48
+
1. In the **Login** page, under the **SQL server authentication**label, enter a **Login** and **Password** for a user that has access to the database. If you're not sure, use the login and password for the Server admin of the database's server.
4. In the **Login** page, under the **SQL server authentication** label, enter the **Login** ID and **Password** of the server admin account used to create the database. Then select**OK**.
Configuring an Azure Active Directory (Azure AD) administrator enables you to use a single identity to sign in to the Azure portal and your SQL database. Follow the steps below to configure an Azure AD admin for your SQL server.
57
+
Configuring an Azure Active Directory (Azure AD) administrator enables you to use a single identity to sign in to the Azure portal and your SQL database. To connect to your database using Azure AD, follow the steps below to configure an Azure AD admin for your SQL server.
62
58
63
59
> [!NOTE]
64
60
> * Email accounts (for example, outlook.com, gmail.com, yahoo.com, and so on) aren't yet supported as Azure AD admins. Make sure to choose a user created either natively in the Azure AD, or federated into the Azure AD.
65
61
> * Azure AD admin sign in doesn't work with accounts that have 2-factor authentication enabled.
66
62
67
-
1. On the Azure portal menu or from the **Home** page, select **All resources**.
68
-
69
-
2. Select your SQL server.
63
+
1. In the Azure portal, select your SQL server.
70
64
71
-
3. From the **SQL server** menu, under **Settings**, select **Active Directory admin**.
65
+
2. On the **SQL server** menu, select **Active Directory admin**.
72
66
73
-
4. From the SQL server **Active Directory admin** page toolbar, select **Set admin** and choose the user or group as your Azure AD admin.
67
+
3. On the SQL server **Active Directory admin** page toolbar, select **Set admin** and choose the user or group as your Azure AD admin.
74
68
75
69

76
70
77
-
5. From the **Add admin** page, in the search box, enter a user or group to find, select it as an admin, and then choose the **Select** button.
71
+
4. On the **Add admin** page, in the search box, enter a user or group to find, select it as an admin, and then choose the **Select** button.
72
+
73
+
5. Back in the SQL server **Active Directory admin** page toolbar, select **Save**.
78
74
79
-
6. Back in the SQL server **Active Directory admin** page toolbar, select **Save**.
75
+
### Connect to the database
80
76
81
-
7. In the **SQL server** menu, select **SQL databases**, and then select your SQL database.
77
+
6. In the **SQL server** menu, select **SQL databases**, and then select your SQL database.
82
78
83
-
8. In the **SQL database** menu, select **Query editor (preview)**. In the **Login** page, under the **Active Directory authentication** label, a message appears saying you have been signed in if you're an Azure AD admin. Then select the **Continue as***\<your user or group ID>* button.
79
+
7. In the **SQL database** menu, select **Query editor (preview)**. In the **Login** page, under the **Active Directory authentication** label, a message appears saying you have been signed in if you're an Azure AD admin. Then select the **Continue as***\<your user or group ID>* button. If the page indicates that you have not successfully logged in, you may need to refresh the page.
84
80
85
-
## View data
81
+
## Run a query to view data
86
82
87
-
1.After you're authenticated, paste the following SQL in the query editor to retrieve the top 20 products by category.
83
+
1.Paste the following query into the query editor:
88
84
89
85
```sql
90
86
SELECT TOP 20pc.Nameas CategoryName, p.nameas ProductName
@@ -93,13 +89,13 @@ Configuring an Azure Active Directory (Azure AD) administrator enables you to us
93
89
ONpc.productcategoryid=p.productcategoryid;
94
90
```
95
91
96
-
2.On the toolbar, select**Run** and then review the output in the **Results** pane.
92
+
2.Select**Run** and then review the output in the **Results** pane.
Run the following [INSERT](https://msdn.microsoft.com/library/ms174335.aspx) Transact-SQL statement to add a new product in the `SalesLT.Product` table.
98
+
Run the following [INSERT](/sql/t-sql/statements/insert-transact-sql/) Transact-SQL statement to add a new product in the `SalesLT.Product` table.
103
99
104
100
1. Replace the previous query with this one.
105
101
@@ -127,9 +123,9 @@ Run the following [INSERT](https://msdn.microsoft.com/library/ms174335.aspx) Tra
127
123
2. Select **Run** to insert a new row in the `Product` table. The **Messages** pane displays **Query succeeded: Affected rows: 1**.
128
124
129
125
130
-
## Update data
126
+
## Run a query to update data
131
127
132
-
Run the following [UPDATE](https://msdn.microsoft.com/library/ms177523.aspx) Transact-SQL statement to modify your new product.
128
+
Run the following [UPDATE](/sql/t-sql/queries/update-transact-sql/) Transact-SQL statement to modify your new product.
133
129
134
130
1. Replace the previous query with this one.
135
131
@@ -141,9 +137,9 @@ Run the following [UPDATE](https://msdn.microsoft.com/library/ms177523.aspx) Tra
141
137
142
138
2. Select **Run** to update the specified row in the `Product` table. The **Messages** pane displays **Query succeeded: Affected rows: 1**.
143
139
144
-
## Delete data
140
+
## Run a query to delete data
145
141
146
-
Run the following [DELETE](https://msdn.microsoft.com/library/ms189835.aspx) Transact-SQL statement to remove your new product.
142
+
Run the following [DELETE](/sql/t-sql/statements/delete-transact-sql/) Transact-SQL statement to remove your new product.
147
143
148
144
1. Replace the previous query with this one:
149
145
@@ -159,19 +155,19 @@ Run the following [DELETE](https://msdn.microsoft.com/library/ms189835.aspx) Tra
159
155
160
156
There are a few things to know when working with the query editor.
161
157
162
-
* The query editor uses ports 443 and 1443 to communicate. Please ensure you have enabled outbound HTTPS traffic on these ports. You will also need to add your outbound IP address to the server's allowed firewall rules to access your databases and data warehouses.
158
+
* The query editor uses ports 443 and 1443 to communicate. Ensure you have enabled outbound HTTPS traffic on these ports. You will also need to add your outbound IP address to the server's allowed firewall rules to access your databases and data warehouses.
163
159
164
-
* Pressing F5 refreshes the query editor page and any query being worked on is lost.
160
+
* Pressing **F5** refreshes the query editor page and any query being worked on is lost.
165
161
166
162
* Query editor doesn't support connecting to the `master` database.
167
163
168
164
* There's a 5-minute timeout for query execution.
169
165
170
166
* The query editor only supports cylindrical projection for geography data types.
171
167
172
-
* There's no support for IntelliSense for database tables and views. However, the editor does support autocomplete on names that have already been typed.
168
+
* There's no support for IntelliSense for database tables and views, but the editor does support autocomplete on names that have already been typed.
173
169
174
170
175
171
## Next steps
176
172
177
-
To learn more about the Transact-SQL supported in Azure SQL databases, see [Resolving Transact-SQL differences during migration to SQL Database](sql-database-transact-sql-information.md).
173
+
To learn more about the Transact-SQL (T-SQL) supported in Azure SQL databases, see [Resolving Transact-SQL differences during migration to SQL Database](sql-database-transact-sql-information.md).
0 commit comments