Skip to content

Commit a5e1326

Browse files
committed
increase Acrolinx scores
1 parent de3ab62 commit a5e1326

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

articles/synapse-analytics/sql-data-warehouse/sql-data-warehouse-develop-group-by-options.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The [GROUP BY](/sql/t-sql/queries/select-group-by-transact-sql) T-SQL clause agg
2727

2828
## Rollup and grouping sets options
2929

30-
The simplest option here is to use UNION ALL instead to perform the rollup rather than relying on the explicit syntax. The result is exactly the same.
30+
The simplest option here is to use UNION ALL to perform the rollup rather than relying on the explicit syntax. The result is exactly the same.
3131

3232
The following example using the GROUP BY statement with the ROLLUP option:
3333
```sql
@@ -79,11 +79,11 @@ JOIN dbo.DimSalesTerritory t ON s.SalesTerritoryKey = t.SalesTerritor
7979
To replace GROUPING SETS, the sample principle applies. You only need to create UNION ALL sections for the aggregation levels you want to see.
8080

8181
## Cube options
82-
It is possible to create a GROUP BY WITH CUBE using the UNION ALL approach. The problem is that the code can quickly become cumbersome and unwieldy. To mitigate this issue, you can use this more advanced approach.
82+
It's possible to create a GROUP BY WITH CUBE using the UNION ALL approach. The problem is that the code can quickly become cumbersome and unwieldy. To mitigate this issue, you can use this more advanced approach.
8383

8484
Using the previous example, the first step is to define the 'cube' that defines all the levels of aggregation that we want to create.
8585

86-
It is important to take note of the CROSS JOIN of the two derived tables. This generates all the levels for us. The rest of the code is there for formatting:
86+
Take note of the CROSS JOIN of the two derived tables since this generates all the levels for us. The rest of the code is there for formatting:
8787

8888
```sql
8989
CREATE TABLE #Cube
@@ -141,7 +141,7 @@ WITH
141141
;
142142
```
143143

144-
The third step is to loop over our cube of columns performing the aggregation. The query will run once for every row in the #Cube temporary table and store the results in the #Results temp table:
144+
The third step is to loop over our cube of columns performing the aggregation. The query will run once for every row in the #Cube temporary table. The results are stored in the #Results temp table:
145145

146146
```sql
147147
SET @nbr =(SELECT MAX(Seq) FROM #Cube);

articles/synapse-analytics/sql-data-warehouse/sql-data-warehouse-develop-label.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ OPTION (LABEL = 'My Query Label')
2727
;
2828
```
2929

30-
The last line tags the string 'My Query Label' to the query. This tag is particularly helpful since the label is query-able through the DMVs.
30+
The last line tags the string 'My Query Label' to the query. This tag is helpful because the label is query-able through the DMVs.
3131

3232
Querying for labels provides a mechanism for locating problem queries and helping to identify progress through an ELT run.
3333

34-
A good naming convention really helps. For example, starting the label with PROJECT, PROCEDURE, STATEMENT, or COMMENT helps to uniquely identify the query among all the code in source control.
34+
A good naming convention really helps. For example, starting the label with PROJECT, PROCEDURE, STATEMENT, or COMMENT uniquely identifies the query among all the code in source control.
3535

3636
The following query uses a dynamic management view to search by label.
3737

articles/synapse-analytics/sql-data-warehouse/sql-data-warehouse-develop-loops.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ ms.custom: seo-lt-2019
1414
---
1515

1616
# Using T-SQL loops in Synapse SQL pool
17-
Included in this article are tips for solution development using T-SQL loops and replacing cursors in SQL pool.
17+
Included in this article are tips for SQL pool solution development using T-SQL loops and replacing cursors.
1818

1919
## Purpose of WHILE loops
2020

2121
Synapse SQL pool supports the [WHILE](https://docs.microsoft.com/sql/t-sql/language-elements/while-transact-sql?view=sql-server-ver15) loop for repeatedly executing statement blocks. This WHILE loop continues for as long as the specified conditions are true or until the code specifically terminates the loop using the BREAK keyword.
2222

23-
Loops are useful for replacing cursors defined in SQL code. Fortunately, almost all cursors that are written in SQL code are of the fast forward, read-only variety. Therefore, WHILE loops are a great alternative for replacing cursors.
23+
Loops are useful for replacing cursors defined in SQL code. Fortunately, almost all cursors that are written in SQL code are of the fast forward, read-only variety. So, WHILE loops are a great alternative for replacing cursors.
2424

2525
## Replacing cursors in Synapse SQL pool
2626
However, before diving in head first you should ask yourself the following question: "Could this cursor be rewritten to use set-based operations?"

articles/synapse-analytics/sql-data-warehouse/sql-data-warehouse-develop-stored-procedures.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ This article provides tips for developing SQL pool solutions by implementing sto
2020

2121
SQL pool supports many of the T-SQL features that are used in SQL Server. More importantly, there are scale-out specific features that you can use to maximize the performance of your solution.
2222

23-
However, to maintain the scale and performance of SQL pool there are also some features and functionality that have behavioral differences and others that are not supported.
23+
Also, to help you maintain the scale and performance of SQL pool, there are additional features and functionalities that have behavioral differences.
2424

2525

2626
## Introducing stored procedures
27-
Stored procedures are a great way for encapsulating your SQL code; storing it close to your data in the data warehouse. Stored procedures help developers modularize their solutions by encapsulating the code into manageable units; facilitating greater reusability of code. Each stored procedure can also accept parameters to make them even more flexible.
27+
Stored procedures are a great way for encapsulating your SQL code, which is stored close to your SQL pool data. Stored procedures also help developers modularize their solutions by encapsulating the code into manageable units, thus facilitating greater code reusability. Each stored procedure can also accept parameters to make them even more flexible.
2828

29-
SQL pool provides a simplified and streamlined stored procedure implementation. The biggest difference compared to SQL Server is that the stored procedure is not pre-compiled code.
29+
SQL pool provides a simplified and streamlined stored procedure implementation. The biggest difference compared to SQL Server is that the stored procedure isn't pre-compiled code.
3030

31-
In general, for data warehouses, the compilation time is small in comparison to the time it takes to run queries against large data volumes. It is more important to ensure the stored procedure code is correctly optimized for large queries. The goal is to save hours, minutes, and seconds, not milliseconds. It is therefore more helpful to think of stored procedures as containers for SQL logic.
31+
In general, for data warehouses, the compilation time is small in comparison to the time it takes to run queries against large data volumes. It's more important to ensure the stored procedure code is correctly optimized for large queries. The goal is to save hours, minutes, and seconds, not milliseconds. So, it's helpful to think of stored procedures as containers for SQL logic.
3232

3333
When SQL pool executes your stored procedure, the SQL statements are parsed, translated, and optimized at run time. During this process, each statement is converted into distributed queries. The SQL code that is executed against the data is different than the query submitted.
3434

3535
## Nesting stored procedures
3636
When stored procedures call other stored procedures, or execute dynamic SQL, then the inner stored procedure or code invocation is said to be nested.
3737

38-
SQL pool supports a maximum of eight nesting levels. This is slightly different to SQL Server. The nest level in SQL Server is 32.
38+
SQL pool supports a maximum of eight nesting levels. In contrast, the nest level in SQL Server is 32.
3939

4040
The top-level stored procedure call equates to nest level 1.
4141

@@ -61,13 +61,13 @@ GO
6161
EXEC prc_nesting
6262
```
6363
64-
Note, SQL pool does not currently support [@@NESTLEVEL](/sql/t-sql/functions/nestlevel-transact-sql). You need to track the nest level. It is unlikely that you'll exceed the eight nest level limit, but if you do, you need to rework your code to fit the nesting levels within this limit.
64+
SQL pool doesn't currently support [@@NESTLEVEL](/sql/t-sql/functions/nestlevel-transact-sql). As such, you need to track the nest level. It's unlikely that you'll exceed the eight nest level limit. But, if you do, you need to rework your code to fit the nesting levels within this limit.
6565

6666
## INSERT..EXECUTE
67-
SQL pool does not permit you to consume the result set of a stored procedure with an INSERT statement. However, there is an alternative approach you can use. For an example, see the article on [temporary tables](sql-data-warehouse-tables-temporary.md).
67+
SQL pool doesn't permit you to consume the result set of a stored procedure with an INSERT statement. There is, however, an alternative approach you can use. For an example, see the article on [temporary tables](sql-data-warehouse-tables-temporary.md).
6868
6969
## Limitations
70-
There are some aspects of Transact-SQL stored procedures that are not implemented in SQL pool, and they are as follows:
70+
There are some aspects of Transact-SQL stored procedures that aren't implemented in SQL pool, which are as follows:
7171

7272
* temporary stored procedures
7373
* numbered stored procedures

0 commit comments

Comments
 (0)