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
+17-12Lines changed: 17 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,20 +15,20 @@ ms.date: 03/12/2020
15
15
---
16
16
# Quickstart: Use the Azure portal's query editor to query a SQL database
17
17
18
-
The query editor is a tool in the Azure portal for running SQL queries against your Azure SQL Database or Azure SQL Data Warehouse.
18
+
The query editor is a tool in the Azure portal for running SQL queries against your Azure SQL database or Azure SQL Data Warehouse.
19
19
20
-
In this quickstart, you'll use the query editor in the portal to run Transact-SQL (T-SQL) queries against an Azure SQL database.
20
+
In this quickstart, you'll use the query editor to run Transact-SQL (T-SQL) queries against an Azure SQL database.
21
21
22
22
23
23
## Prerequisites
24
24
25
-
To complete this quickstart you need the AdventureWorksLT sample database. If you don't have a working copy of the AdventureWorksLT SQL Database, the following quickstart quickly creates one:
25
+
Completing this quickstart requires the AdventureWorksLT sample database. If you don't have a working copy of the AdventureWorksLT SQL database, the following quickstart quickly creates one:
26
26
27
27
-[Quickstart: Create a single Azure SQL database using the Azure portal, PowerShell, or Azure CLI](sql-database-single-database-get-started.md)
28
28
29
29
### Configure network settings
30
30
31
-
If you get one of the following errors in the query editor: *Your local network settings might be preventing the Query Editor from issuing queries. Please click here for instructions on how to configure your network settings*, or *A connection to the server could not be established. This might indicate an issue with your local firewall configuration or your network proxy settings.*. The following important information should help with these errors:
31
+
If you get one of the following errors in the query editor: *Your local network settings might be preventing the Query Editor from issuing queries. Please click here for instructions on how to configure your network settings*, or *A connection to the server could not be established. This might indicate an issue with your local firewall configuration or your network proxy settings*, the following important information should help resolve:
32
32
33
33
> [!IMPORTANT]
34
34
> The query editor uses ports 443 and 1443 to communicate. Ensure you have enabled outbound HTTPS traffic on these ports. You also need to [add your outbound IP address to the server's allowed firewall rules](sql-database-server-level-firewall-rule.md) to access your databases and data warehouses.
@@ -43,10 +43,11 @@ If you get one of the following errors in the query editor: *Your local network
Even though you're signed into the portal, you still need to provide credentials to access the SQL database. You can connect using SQL authentication or Azure Active Directory to connect to your database.
48
49
49
-
Even though you're signed into the portal, you still need to provide credentials to access the SQL database. If you use Azure Active Directory to connect to your database, skip to [the following section](#connect-using-azure-active-directory).
50
+
### Connect using SQL Authentication
50
51
51
52
1. In the **Login** page, under **SQL server authentication**, 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.
52
53
@@ -55,15 +56,15 @@ Even though you're signed into the portal, you still need to provide credentials
55
56
2. Select **OK**.
56
57
57
58
58
-
## Connect using Azure Active Directory
59
+
###Connect using Azure Active Directory
59
60
60
61
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.
61
62
62
63
> [!NOTE]
63
64
> * 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.
64
65
> * Azure AD admin sign in doesn't work with accounts that have 2-factor authentication enabled.
65
66
66
-
### Set an Active Directory admin for the database server
67
+
####Set an Active Directory admin for the database server
67
68
68
69
1. In the Azure portal, select your SQL server.
69
70
@@ -83,7 +84,11 @@ Configuring an Azure Active Directory (Azure AD) administrator enables you to us
83
84
84
85
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.
85
86
86
-
## Run a Select query
87
+
## Query a SQL database
88
+
89
+
The following example queries should run successfully against the AdventureWorksLT sample database.
90
+
91
+
### Run a SELECT query
87
92
88
93
1. Paste the following query into the query editor:
89
94
@@ -100,7 +105,7 @@ Configuring an Azure Active Directory (Azure AD) administrator enables you to us
100
105
101
106
3. Optionally, you can save the query as a .sql file, or export the returned data as a .json, .csv, or .xml file.
102
107
103
-
## Run an Insert query
108
+
###Run an INSERT query
104
109
105
110
Run the following [INSERT](/sql/t-sql/statements/insert-transact-sql/) T-SQL statement to add a new product in the `SalesLT.Product` table.
106
111
@@ -130,7 +135,7 @@ Run the following [INSERT](/sql/t-sql/statements/insert-transact-sql/) T-SQL sta
130
135
2. Select **Run** to insert a new row in the `Product` table. The **Messages** pane displays **Query succeeded: Affected rows: 1**.
131
136
132
137
133
-
## Run an Update query
138
+
###Run an UPDATE query
134
139
135
140
Run the following [UPDATE](/sql/t-sql/queries/update-transact-sql/) T-SQL statement to modify your new product.
136
141
@@ -144,7 +149,7 @@ Run the following [UPDATE](/sql/t-sql/queries/update-transact-sql/) T-SQL statem
144
149
145
150
2. Select **Run** to update the specified row in the `Product` table. The **Messages** pane displays **Query succeeded: Affected rows: 1**.
146
151
147
-
## Run a Delete query
152
+
###Run a DELETE query
148
153
149
154
Run the following [DELETE](/sql/t-sql/statements/delete-transact-sql/) T-SQL statement to remove your new product.
0 commit comments