Skip to content

Commit 280da68

Browse files
committed
Refresh ADS articles
Mostly to do away with "Docker" references
1 parent a515958 commit 280da68

2 files changed

Lines changed: 308 additions & 381 deletions

File tree

docs/azure-data-studio/quickstart-sql-server.md

Lines changed: 74 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ title: "Quickstart: Connect and query SQL Server"
33
description: Do a quickstart in which you use Azure Data Studio to connect to SQL Server and then use Transact-SQL (T-SQL) statements to create a database.
44
author: erinstellato-ms
55
ms.author: erinstellato
6-
ms.reviewer: "maghan"
7-
ms.date: 07/11/2022
6+
ms.reviewer: maghan, randolphwest
7+
ms.date: 01/16/2023
88
ms.service: azure-data-studio
99
ms.topic: "quickstart"
1010
ms.custom:
@@ -18,25 +18,25 @@ This quickstart shows how to use Azure Data Studio to connect to SQL Server, and
1818

1919
## Prerequisites
2020

21-
To complete this quickstart, you need Azure Data Studio, and access to SQL Server.
21+
To complete this quickstart, you need Azure Data Studio, and access to a SQL Server instance.
2222

2323
- [Install Azure Data Studio](./download-azure-data-studio.md).
2424

2525
If you don't have access to a SQL Server, select your platform from the following links (make sure you remember your SQL Login and Password!):
2626

27-
- [Windows - Download SQL Server 2019 Developer Edition](https://www.microsoft.com/sql-server/sql-server-downloads)
28-
- [macOS - Download SQL Server 2019 on Docker](../linux/quickstart-install-connect-docker.md)
29-
- [Linux - Download SQL Server 2019 Developer Edition](../linux/sql-server-linux-overview.md#install) - You only need to follow the steps up to *Create and Query Data*.
27+
- [Windows - Download SQL Server 2022 Developer Edition](https://www.microsoft.com/sql-server/sql-server-downloads)
28+
- [Linux - Download SQL Server 2022 in a container](../linux/quickstart-install-connect-docker.md)
29+
- [Linux - Download SQL Server 2022 Developer Edition](../linux/sql-server-linux-overview.md#install) - You only need to follow the steps up to *Create and Query Data*.
3030

3131
## Connect to a SQL Server
3232

3333
1. Start **Azure Data Studio**.
3434

35-
2. The first time you run Azure Data Studio the **Welcome** page should open. If you don't see the **Welcome** page, select **Help** > **Welcome**. Select **New Connection** to open the **Connection** pane:
35+
1. The first time you run Azure Data Studio the **Welcome** page should open. If you don't see the **Welcome** page, select **Help** > **Welcome**. Select **New Connection** to open the **Connection** pane:
3636

37-
![New Connection Icon](media/quickstart-sql-server/new-connection-icon.png)
37+
:::image type="content" source="media/quickstart-sql-server/new-connection-icon.png" alt-text="Screenshot showing the New Connection icon.":::
3838

39-
3. This article uses *SQL Login*, but *Windows Authentication* is supported. Fill in the fields as follows:
39+
1. This article uses *SQL Login*, but *Windows Authentication* is supported. Fill in the fields as follows:
4040

4141
- **Server Name:** Enter server name here. For example, localhost.
4242
- **Authentication Type:** SQL Login
@@ -45,93 +45,99 @@ If you don't have access to a SQL Server, select your platform from the followin
4545
- **Database Name:** \<Default\>
4646
- **Server Group:** \<Default\>
4747

48-
![New Connection Screen](media/quickstart-sql-server/new-connection-screen.png)
48+
:::image type="content" source="media/quickstart-sql-server/new-connection-screen.png" alt-text="Screenshot showing the New Connection screen.":::
4949

5050
## Create a database
5151

5252
The following steps create a database named **TutorialDB**:
5353

5454
1. Right-click on your server, **localhost**, and select **New Query**.
5555

56-
2. Paste the following snippet into the query window: and then select **Run**.
57-
58-
```sql
59-
USE master
60-
GO
61-
IF NOT EXISTS (
62-
SELECT name
63-
FROM sys.databases
64-
WHERE name = N'TutorialDB'
65-
)
66-
CREATE DATABASE [TutorialDB];
67-
GO
68-
IF SERVERPROPERTY('ProductVersion') > '12'
69-
ALTER DATABASE [TutorialDB] SET QUERY_STORE=ON;
70-
GO
71-
```
56+
1. Paste the following snippet into the query window: and then select **Run**.
57+
58+
```sql
59+
USE master;
60+
GO
61+
62+
IF NOT EXISTS (
63+
SELECT name
64+
FROM sys.databases
65+
WHERE name = N'TutorialDB'
66+
)
67+
CREATE DATABASE [TutorialDB];
68+
GO
69+
70+
IF SERVERPROPERTY('ProductVersion') > '12'
71+
ALTER DATABASE [TutorialDB] SET QUERY_STORE = ON;
72+
GO
73+
```
7274

7375
After the query completes, the new **TutorialDB** appears in the list of databases. If you don't see it, right-click the **Databases** node and select **Refresh**.
7476

75-
![Create database](media/quickstart-sql-server/create-database.png)
77+
:::image type="content" source="media/quickstart-sql-server/create-database.png" alt-text="Screenshot showing how to create database.":::
7678

7779
## Create a table
7880

7981
The query editor is still connected to the *master* database, but we want to create a table in the *TutorialDB* database.
8082

8183
1. Change the connection context to **TutorialDB**:
8284

83-
![Change context](media/quickstart-sql-server/change-context.png)
84-
85-
2. Paste the following snippet into the query window and click **Run**:
86-
87-
> [!NOTE]
88-
> You can append this too, or overwrite the previous query in the editor. Note that clicking **Run** executes only the query that is selected. If nothing is selected, clicking **Run** executes all queries in the editor.
89-
90-
```sql
91-
-- Create a new table called 'Customers' in schema 'dbo'
92-
-- Drop the table if it already exists
93-
IF OBJECT_ID('dbo.Customers', 'U') IS NOT NULL
94-
DROP TABLE dbo.Customers;
95-
GO
96-
-- Create the table in the specified schema
97-
CREATE TABLE dbo.Customers
98-
(
99-
CustomerId int NOT NULL PRIMARY KEY, -- primary key column
100-
Name nvarchar(50) NOT NULL,
101-
Location nvarchar(50) NOT NULL,
102-
Email nvarchar(50) NOT NULL
103-
);
104-
GO
85+
:::image type="content" source="media/quickstart-sql-server/change-context.png" alt-text="Screenshot showing how to change context.":::
86+
87+
1. Paste the following snippet into the query window and select **Run**:
88+
89+
> [!NOTE]
90+
> You can append this too, or overwrite the previous query in the editor. Note that selecting **Run** executes only the query that is selected. If nothing is selected, selecting **Run** executes all queries in the editor.
91+
92+
```sql
93+
-- Create a new table called 'Customers' in schema 'dbo'
94+
-- Drop the table if it already exists
95+
IF OBJECT_ID('dbo.Customers', 'U') IS NOT NULL
96+
DROP TABLE dbo.Customers;
97+
GO
98+
99+
-- Create the table in the specified schema
100+
CREATE TABLE dbo.Customers (
101+
CustomerId INT NOT NULL PRIMARY KEY, -- primary key column
102+
[Name] NVARCHAR(50) NOT NULL,
103+
[Location] NVARCHAR(50) NOT NULL,
104+
[Email] NVARCHAR(50) NOT NULL
105+
);
106+
GO
105107
```
106108

107109
After the query completes, the new **Customers** table appears in the list of tables. You might need to right-click the **TutorialDB > Tables** node and select **Refresh**.
108110

109111
## Insert rows
110112

111-
- Paste the following snippet into the query window and click **Run**:
112-
113-
```sql
114-
-- Insert rows into table 'Customers'
115-
INSERT INTO dbo.Customers
116-
([CustomerId], [Name], [Location], [Email])
117-
VALUES
118-
( 1, N'Orlando', N'Australia', N''),
119-
( 2, N'Keith', N'India', N'keith0@adventure-works.com'),
120-
( 3, N'Donna', N'Germany', N'donna0@adventure-works.com'),
121-
( 4, N'Janet', N'United States', N'janet1@adventure-works.com')
122-
GO
123-
```
113+
Paste the following snippet into the query window and select **Run**:
114+
115+
```sql
116+
-- Insert rows into table 'Customers'
117+
INSERT INTO dbo.Customers (
118+
[CustomerId],
119+
[Name],
120+
[Location],
121+
[Email]
122+
)
123+
VALUES
124+
(1, N'Orlando', N'Australia', N''),
125+
(2, N'Keith', N'India', N'keith0@adventure-works.com'),
126+
(3, N'Donna', N'Germany', N'donna0@adventure-works.com'),
127+
(4, N'Janet', N'United States', N'janet1@adventure-works.com')
128+
GO
129+
```
124130

125131
## View the data returned by a query
126132

127-
- Paste the following snippet into the query window and click **Run**:
133+
Paste the following snippet into the query window and select **Run**:
128134

129-
```sql
130-
-- Select rows from table 'Customers'
131-
SELECT * FROM dbo.Customers;
132-
```
135+
```sql
136+
-- Select rows from table 'Customers'
137+
SELECT * FROM dbo.Customers;
138+
```
133139

134-
![Select results](media/quickstart-sql-server/select-results.png)
140+
:::image type="content" source="media/quickstart-sql-server/select-results.png" alt-text="Screenshot showing the results from the SELECT query.":::
135141

136142
## Next steps
137143

0 commit comments

Comments
 (0)