Skip to content

Commit 58c2af2

Browse files
author
stevestein
committed
edits, cleaning
1 parent 5d8b612 commit 58c2af2

3 files changed

Lines changed: 64 additions & 54 deletions

File tree

docs/carbon/get-started-sql-database.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ This quickstart demonstrates how to use [!INCLUDE[name-sos](../includes/name-sos
2020

2121
## Prerequisites
2222

23-
To complete this quickstart, you need !INCLUDE[name-sos](../includes/name-sos-short.md), and an Azure SQL server where you have *CREATE DATABASE* permissions.
23+
To complete this quickstart, you need [!INCLUDE[name-sos](../includes/name-sos-short.md)], and an Azure SQL server where you have *CREATE DATABASE* permissions.
2424

2525
- [Install [!INCLUDE[name-sos](../includes/name-sos-short.md)]](download.md).
2626

27-
If you don't already have an Azure SQL server, complete any one of the following Azure SQL Database quickstarts:
27+
If you don't already have an Azure SQL server, complete one of the following Azure SQL Database quickstarts:
2828

2929
- [Create DB - Portal](https://docs.microsoft.com/azure/sql-database/sql-database-get-started-portal)
3030
- [Create DB - CLI](https://docs.microsoft.com/azure/sql-database/sql-database-get-started-cli)

docs/carbon/get-started-sql-server.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ This article shows how to get started using [!INCLUDE[name-sos](../includes/name
2020

2121
## Prerequisites
2222

23-
To complete this quickstart, you need [!INCLUDE[name-sos](../includes/name-sos-short.md)], and access to a SQL Server where you have *CREATE DATABASE* permissions.
23+
To complete this quickstart, you need [!INCLUDE[name-sos](../includes/name-sos-short.md)], and access to a SQL Server.
2424

2525
- [Install [!INCLUDE[name-sos](../includes/name-sos-short.md)]](download.md).
2626

27-
If you don't have access to a SQL Server, the following links get you setup for free:
28-
- [Download SQL Server 2017 Developer Edition for Windows](https://www.microsoft.com/en-us/sql-server/sql-server-downloads)
29-
- [Download SQL Server 2017 on Docker](https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker)
30-
- [Download SQL Server 2017 Developer Edition on Linux](https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-overview#install)
27+
If you don't have access to a SQL Server, select your platform from the following links:
28+
- [Windows - Download SQL Server 2017 Developer Edition](https://www.microsoft.com/en-us/sql-server/sql-server-downloads)
29+
- [macOS - Download SQL Server 2017 on Docker](https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker)
30+
- [Linux - Download SQL Server 2017 Developer Edition](https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-overview#install)
3131

3232

3333
### Windows
@@ -124,7 +124,7 @@ After the query completes, the new **Customers** table appears in the list of ta
124124

125125
## Insert rows
126126

127-
1. Paste the following snippet into the query window:
127+
1. Paste the following snippet into the query window:
128128
```sql
129129
-- Insert rows into table 'Customers'
130130
INSERT INTO dbo.Customers

docs/carbon/tutorial-modern-code-flow-sql-server.md

Lines changed: 56 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Run SQL queries using Microsoft SQL Operations Studio | Microsoft Docs
3-
description: This tutorial...
2+
title: Working with T-SQL using Microsoft SQL Operations Studio | Microsoft Docs
3+
description: This tutorial walks through the key features in SQL Operations Studio that simplify using T-SQL.
44
keywords:
55
ms.custom: "tools|sos"
66
ms.date: "11/01/2017"
@@ -15,7 +15,7 @@ manager: craigg
1515
ms.workload: "Inactive"
1616
---
1717

18-
# Create and run queries using [!INCLUDE[name-sos](../includes/name-sos-short.md)]
18+
# Working with T-SQL using [!INCLUDE[name-sos](../includes/name-sos-short.md)]
1919

2020
Creating and running queries, stored procedures, scripts, etc. are the core tasks of database professionals. This tutorial walks through the key features in [!INCLUDE[name-sos](../includes/name-sos-short.md)] that simplify using T-SQL.
2121

@@ -29,51 +29,61 @@ In this tutorial, you learn how to use [!INCLUDE[name-sos-short](../includes/nam
2929

3030
## Prerequisites
3131

32-
To complete this tutorial, [install [!INCLUDE[name-sos](../includes/name-sos-short.md)]](download.md).
32+
This tutorial requires the *TutorialDB* database. To create the *TutorialDB* database, complete one of the following quickstarts:
3333

34+
- [Connect and query SQL Server using [!INCLUDE[name-sos-short](../includes/name-sos-short.md)]](get-started-sql-server.md)
35+
- [Connect and query Azure SQL Database using [!INCLUDE[name-sos-short](../includes/name-sos-short.md)]](get-started-sql-database.md)
36+
- [Connect and query SQL Data Warehouse using [!INCLUDE[name-sos-short](../includes/name-sos-short.md)]](get-started-sql-dw.md)
3437

35-
## Quickly find a table and edit data
36-
[!INCLUDE[name-sos-short](../includes/name-sos-short.md)] provides a quick database schema object search functionality using 'Explorer widget' in a dashboard and quickly launch a task based on an object type such as 'Edit data' for a table.
3738

38-
1. Open Servers viewlet with ```CTRL+G``` and expand ```Databases``` folder. Select ```TutorialDB```.
3939

40-
2. Open TutorialDB Dashboard using ```Manage``` context menu with right-mouse-click.
40+
## Quickly locate a database object and perform a common task
4141

42-
![manage context menu](./media/tutorial-sql-server/insight-open-dashboard.png)
42+
[!INCLUDE[name-sos-short](../includes/name-sos-short.md)] provides a search widget to quickly find database objects. The results list provides a context menu for common tasks relevant to the selected object, such as *Edit Data* for a table.
4343

44-
3. Type ```Customer``` in Search widget as shown below.
44+
1. Open the SERVERS sidebar (**CTRL+G**), expand **Databases**, and select **TutorialDB**.
4545

46-
4. Select ```dbo.Customer``` table from Search widget on the dashboard and run ```Edit data``` context menu with right-mouse-click.
46+
1. Open the *TutorialDB Dashboard* by selecting **Manage** from the context menu.
4747

48-
![quick search widget](./media/tutorial-sql-server/quick-search-widget.png)
48+
![context menu - Manage](./media/tutorial-sql-server/insight-open-dashboard.png)
49+
50+
1. Locate the *Customers* table by typing *cus* in the search widget.
51+
1. Right-click **dbo.Customers** and select **Edit data**.
4952

50-
5. Select ```Email``` column in the first row and type in ```jared@vsdata.io```.
53+
![quick search widget](./media/tutorial-sql-server/quick-search-widget.png)
5154

52-
6. Click Refresh. The result is shown in the screenshot below.
55+
1. Edit the **Email** column in the first row, type *jared@vsdata.io*, and click outside the cell to save the change.
5356

5457
![edit data](./media/tutorial-sql-server/edit-data.png)
5558

56-
## Use T-SQL snippet and IntelliSense to create a stored procedure
59+
## Use T-SQL snippets and IntelliSense to create a stored procedure
5760

58-
1. Press 'CTRL + N' to open a new editor.
61+
### Use snippets in [!INCLUDE[name-sos-short](../includes/name-sos-short.md)]
5962

60-
2. Type ```sql``` in the editor, then select ```sqlCreateStoredProcedure```. Press ```Tab```. [!INCLUDE[name-sos-short](../includes/name-sos-short.md)] creates a new stored procedure snippet.
63+
1. Open a new query editor by pressing **CTRL + N**.
64+
65+
2. Type **sql** in the editor, arrow down to **sqlCreateStoredProcedure**, and press the *Tab* key to load the new stored procedure snippet.
6166

6267
![snippet-list](./media/tutorial-sql-server/snippet-list.png)
6368

64-
3. Type ```GetCustomer```. All ```StoredProcedureName``` entries will change to the specified name.
69+
3. Type *getCustomer* and all *StoredProcedureName* entries will change to *getCustomer*.
70+
6571
![snippet](./media/tutorial-sql-server/snippet.png)
6672

67-
4. Press ```Tab``` and then type ```dbo``` for ```SchemaName``` entry.
73+
4. Press *Tab* and then type *dbo* to replace the *SchemaName* entries.
6874

69-
5. Type in the following parameter definition.
75+
5. Replace ```@param1...``` with:
7076

7177
```sql
72-
CREATE PROCEDURE dbo.GetCustomer
7378
@ID int
7479
```
7580

76-
6. Using T-SQL Intellisense, type in the following SELECT statement in the body of procedure. Tip: Type in ```SELECT FROM dbo.Customers c``` first and type the rest as IntelliSense guides you.
81+
### Use IntelliSense in [!INCLUDE[name-sos-short](../includes/name-sos-short.md)]
82+
??THIS DOES NOT WORK AND NEEDS HELP!!??
83+
1. Type in the following SELECT statement in the body of procedure.
84+
85+
> [!TIP]
86+
> Type *SELECT FROM dbo.Customers c*, and complete the rest as IntelliSense guides you.
7787
7888
```sql
7989
SELECT c.CustomersID,
@@ -87,31 +97,33 @@ To complete this tutorial, [install [!INCLUDE[name-sos](../includes/name-sos-sho
8797

8898
![snippet-scripting](./media/tutorial-sql-server/snippet-scripting.png)
8999

90-
7. Press ```F5``` and execute the statement.
100+
7. Delete the example arguments in the EXECUTE statement. The final statement should be: ```EXECUTE dbo.getCustomer 1```.
101+
102+
103+
1. To create the stored procedure and give it a test run, press **F5**.
91104

92105
## Use Peek Definition and Go to Definition
93106

94-
1. Press 'CTRL + N' to open a new editor.
107+
1. Open a new editor by pressing **CTRL + N**.
95108

96-
2. Type and select ```sqlCreateStoredProcedure``` from the snippet suggestion list. Type in ```SetCustomer``` for ```StoredProcedureName``` and ```dbo``` for ```SchemaName```.
97-
3. Specify following parameter:
109+
2. Type and select **sqlCreateStoredProcedure** from the snippet suggestion list. Type in **setCustomer** for **StoredProcedureName** and **dbo** for **SchemaName**
110+
3. Replace the @param lines with the following parameter definition:
98111

99112
```sql
100-
CREATE PROCEDURE dbo.SetCustomer
101113
@json_val nvarchar(max)
102114
```
103115

104-
4. In the body of procedure, type in following:
116+
4. Replace the body of the stored procedure with the following:
105117
```sql
106118
-- body of the stored procedure
107119
INSERT INTO dbo.Customers
108120
```
109121

110-
5. Right-mouse-click on ```dbo.Customers``` and run ```Peek Definition```
122+
5. Right-click **dbo.Customers** and select **Peek Definition**.
111123

112124
![peek definition](./media/tutorial-sql-server/peek-definition.png)
113125

114-
6. By referencing the table defintion in the peek definition, complete the following insert statement.
126+
6. By referencing the table defintion in the peek definition, complete the following insert statement.??WHAT EXACTLY AM I DOING HERE - JUST LOOKING OR DOES THIS HELP ME CREATE THE STATEMENT??
115127

116128
```sql
117129
INSERT INTO dbo.Customers (CustomersID, Name, Location, Email)
@@ -125,18 +137,18 @@ To complete this tutorial, [install [!INCLUDE[name-sos](../includes/name-sos-sho
125137
7. The final statement should be:
126138

127139
```sql
128-
-- Create a new stored procedure called 'SetCustomer' in schema 'dbo'
140+
-- Create a new stored procedure called 'setCustomer' in schema 'dbo'
129141
-- Drop the stored procedure if it already exists
130142
IF EXISTS (
131143
SELECT *
132144
FROM INFORMATION_SCHEMA.ROUTINES
133145
WHERE SPECIFIC_SCHEMA = N'dbo'
134-
AND SPECIFIC_NAME = N'SetCustomer'
146+
AND SPECIFIC_NAME = N'setCustomer'
135147
)
136-
DROP PROCEDURE dbo.SetCustomer
148+
DROP PROCEDURE dbo.setCustomer
137149
GO
138150
-- Create the stored procedure in the specified schema
139-
CREATE PROCEDURE dbo.SetCustomer
151+
CREATE PROCEDURE dbo.setCustomer
140152
@json_val nvarchar(max)
141153
AS
142154
-- body of the stored procedure
@@ -151,25 +163,23 @@ To complete this tutorial, [install [!INCLUDE[name-sos](../includes/name-sos-sho
151163
GO
152164
```
153165

154-
8. Press ```F5``` and execute the script.
155-
156-
## Save as Json
166+
8. Press **F5** and execute the script.
157167

158-
In this step, we will walkthrough how Save as JSON can make a developing and testing application login in stored procedures and using JSON as a data format in applications.
168+
## Save query results as JSON
159169

160-
1. First, run ```SELECT TOP 1000 Rows``` from dbo.Customers table.
170+
In this step, we walkthrough how the **Save as JSON** option makes developing and testing application login in stored procedures and using JSON as a data format in applications.
161171

162-
2. Select and highlight the first row in the result view.
172+
1. **SELECT TOP 1000 Rows** from the *dbo.Customers* table.
163173

164-
3. Click ```Save as Json```. It opens the highlighted row in json format.
174+
2. Select the first row in the results view and click **Save as JSON**. 1. Click **Save**, and it opens the highlighted row in JSON format.
165175

166-
![save as json](./media/tutorial-sql-server/save-as-json.png)
176+
![save as JSON](./media/tutorial-sql-server/save-as-json.png)
167177

168-
4. Select the json data and copy with ```CTRL+C```.
178+
4. Select the JSON data and copy it.
169179

170-
5. Open a new query for TutorialDB and paste the json data into the new query editor.
180+
5. Open a new query for *TutorialDB* and paste the JSON data into the new query editor.
171181

172-
6. Complete the following test script using the json data as a template in the previous step. Modify the values for ```CustomerID```, ```Name```, ```Location``` and ```Email```.
182+
6. Complete the following test script using the json data as a template in the previous step. Modify the values for *CustomerID*, *Name*, *Location*, and *Email*.
173183

174184
```sql
175185
-- example to execute the stored procedure we just created
@@ -189,7 +199,7 @@ In this step, we will walkthrough how Save as JSON can make a developing and tes
189199
EXECUTE dbo.getCustomer @ID = 5
190200
```
191201

192-
7. Press ```F5``` and execute the script. It inserts a new Customer and returns the new Customer's information in json format. Click the result.
202+
7. Execute the script by pressing *F5**. The script inserts a new customer and returns the new customer's information in JSON format. Click the result to open a formatted view.
193203

194204
![test result](./media/tutorial-sql-server/test-result.png)
195205

0 commit comments

Comments
 (0)