Skip to content

Commit c43ab6b

Browse files
authored
Merge pull request #5757 from MicrosoftDocs/FromPublicRepo
Confirm merge from FromPublicRepo to master to sync with https://github.com/MicrosoftDocs/sql-docs (branch live)
2 parents aadb981 + 1fc2d8e commit c43ab6b

6 files changed

Lines changed: 36 additions & 44 deletions

docs/advanced-analytics/tutorials/wrap-python-in-tsql-stored-procedure.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Although it is possible to set up a remote client and run Python code using Visu
2727
2. Create a new database for this project, and change the context of your **Query** window to use the new database.
2828

2929
```sql
30-
CREATE DATABASE sqlpy;
31-
GO;
32-
USE sqlpy;
33-
GO;
30+
CREATE DATABASE sqlpy
31+
GO
32+
USE sqlpy
33+
GO
3434
```
3535

3636
> [!TIP]
@@ -138,4 +138,4 @@ As you think about how you can best encapsulate Python code in T-SQL, also consi
138138

139139
## Next lesson
140140

141-
[Train a Python model and generate scores in SQL Server](../tutorials/train-score-using-python-in-tsql.md)
141+
[Train a Python model and generate scores in SQL Server](../tutorials/train-score-using-python-in-tsql.md)

docs/t-sql/functions/count-big-transact-sql.md

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
title: "COUNT_BIG (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
44
ms.date: "07/24/2017"
@@ -31,7 +31,7 @@ monikerRange: ">= aps-pdw-2016 || = azuresqldb-current || = azure-sqldw-latest |
3131
# COUNT_BIG (-SQL)
3232
[!INCLUDE[tsql-appliesto-ss2008-all-md](../../includes/tsql-appliesto-ss2008-all-md.md)]
3333

34-
Returns the number of items in a group. COUNT_BIG works like the COUNT function. The only difference between the two functions is their return values. COUNT_BIG always returns a **bigint** data type value. COUNT always returns an **int** data type value.
34+
This function returns the number of items found in a group. `COUNT_BIG` operates like the [COUNT](../../t-sql/functions/count-transact-sql.md) function. These functions differ only in the data types of their return values. `COUNT_BIG` always returns a **bigint** data type value. `COUNT` always returns an **int** data type value.
3535

3636
![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
3737

@@ -56,43 +56,34 @@ COUNT_BIG ( { expression | * } ) OVER ( [ <partition_by_clause> ] )
5656

5757
## Arguments
5858
ALL
59-
Applies the aggregate function to all values. ALL is the default.
59+
Applies the aggregate function to all values. ALL serves as the default.
6060

6161
DISTINCT
62-
Specifies that COUNT_BIG returns the number of unique nonnull values.
62+
Specifies that `COUNT_BIG` returns the number of unique nonnull values.
6363

6464
*expression*
65-
Is an [expression](../../t-sql/language-elements/expressions-transact-sql.md) of any type. Aggregate functions and subqueries are not permitted.
65+
An [expression](../../t-sql/language-elements/expressions-transact-sql.md) of any type. Note that `COUNT_BIG` does not support aggregate functions or subqueries in an expression.
6666

6767
*\**
68-
Specifies that all rows should be counted to return the total number of rows in a table. COUNT_BIG(*\**) takes no parameters and cannot be used with DISTINCT. COUNT_BIG(*\**) does not require an *expression* parameter because, by definition, it does not use information about any particular column. COUNT_BIG(*\**) returns the number of rows in a specified table without getting rid of duplicates. It counts each row separately. This includes rows that contain null values.
69-
70-
ALL
71-
Applies the aggregate function to all values. ALL is the default.
72-
73-
DISTINCT
74-
Specifies that AVG be performed only on each unique instance of a value, regardless of how many times the value occurs.
75-
76-
*expression*
77-
Is an [expression](../../t-sql/language-elements/expressions-transact-sql.md) of the exact numeric or approximate numeric data type category, except for the **bit** data type. Aggregate functions and subqueries are not permitted.
68+
Specifies that `COUNT_BIG` should count all rows to determine the total table row count to return. `COUNT_BIG(*)` takes no parameters and does not support the use of DISTINCT. `COUNT_BIG(*)` does not require an *expression* parameter because by definition, it does not use information about any particular column. `COUNT_BIG(*)` returns the number of rows in a specified table, and it preserves duplicate rows. It counts each row separately. This includes rows that contain null values.
7869

7970
OVER **(** [ *partition_by_clause* ] [ *order_by_clause* ] **)**
80-
*partition_by_clause* divides the result set produced by the FROM clause into partitions to which the function is applied. If not specified, the function treats all rows of the query result set as a single group. *order_by_clause* determines the logical order in which the operation is performed. For more information, see [OVER Clause &#40;Transact-SQL&#41;](../../t-sql/queries/select-over-clause-transact-sql.md).
71+
The *partition_by_clause* divides the result set produced by the `FROM` clause into partitions to which the `COUNT_BIG` function is applied. If not specified, the function treats all rows of the query result set as a single group. The *order_by_clause* determines the logical order of the operation. See [OVER Clause &#40;Transact-SQL&#41;](../../t-sql/queries/select-over-clause-transact-sql.md) for more information.
8172

8273
## Return types
8374
**bigint**
8475

8576
## Remarks
86-
COUNT_BIG(*) returns the number of items in a group. This includes NULL values and duplicates.
77+
COUNT_BIG(\*) returns the number of items in a group. This includes NULL values and duplicates.
8778

88-
COUNT_BIG (ALL *expression*) evaluates *expression* for each row in a group and returns the number of nonnull values.
79+
COUNT_BIG (ALL *expression*) evaluates *expression* for each row in a group, and returns the number of nonnull values.
8980

90-
COUNT_BIG (DISTINCT *expression*) evaluates *expression* for each row in a group and returns the number of unique, nonnull values.
81+
COUNT_BIG (DISTINCT *expression*) evaluates *expression* for each row in a group, and returns the number of unique, nonnull values.
9182

92-
COUNT_BIG is a deterministic function when used without the OVER and ORDER BY clauses. It is nondeterministic when specified with the OVER and ORDER BY clauses. For more information, see [Deterministic and Nondeterministic Functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md).
83+
COUNT_BIG is a deterministic function when used ***without*** the OVER and ORDER BY clauses. It is nondeterministic when used ***with*** the OVER and ORDER BY clauses. See [Deterministic and Nondeterministic Functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md) for more information.
9384

9485
## Examples
95-
For examples, see [COUNT &#40;Transact-SQL&#41;](../../t-sql/functions/count-transact-sql.md).
86+
See [COUNT &#40;Transact-SQL&#41;](../../t-sql/functions/count-transact-sql.md) for examples.
9687

9788
## See also
9889
[Aggregate Functions &#40;Transact-SQL&#41;](../../t-sql/functions/aggregate-functions-transact-sql.md)

docs/t-sql/functions/crypt-gen-random-transact-sql.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ manager: craigg
2626
# CRYPT_GEN_RANDOM (Transact-SQL)
2727
[!INCLUDE[tsql-appliesto-ss2008-asdb-xxxx-xxx-md](../../includes/tsql-appliesto-ss2008-asdb-xxxx-xxx-md.md)]
2828

29-
Returns a cryptographic random number generated by the Crypto API (CAPI). The output is a hexadecimal number of the specified number of bytes.
29+
This function returns a cryptographic, randomly-generated number, generated by the Crypto API (CAPI). `CRYPT_GEN_RANDOM` returns a hexadecimal number with a length of a specified number of bytes.
3030

3131
![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
3232

@@ -38,27 +38,27 @@ CRYPT_GEN_RANDOM ( length [ , seed ] )
3838

3939
## Arguments
4040
*length*
41-
The length of the number being created. Maximum is 8000. *length* is type **int**.
41+
The length, in bytes, of the number that `CRYPT_GEN_RANDOM` will create. The *length* argument has an **int** data type, and a value range between 1 and 8000. `CRYPT_GEN_RANDOM` returns NULL for an **int** value outside this range.
4242

4343
*seed*
44-
Optional data to use as a random seed. There must be at least *length* bytes of data. *seed* is **varbinary(8000)**.
44+
An optional hexadecimal number, for use as a random seed value. The length of *seed* must match the value of the *length* argument. The *seed* argument has a **varbinary(8000)** data type.
4545

4646
## Returned Types
4747
**varbinary(8000)**
4848

4949
## Permissions
50-
This function is public and does not require any special permissions.
50+
This function is public and it does not require any special permissions.
5151

5252
## Examples
5353

5454
### A. Generating a random number
55-
The following example generates a random number 50 bytes long.
55+
This example generates a random number of length 50 bytes:
5656

5757
```sql
5858
SELECT CRYPT_GEN_RANDOM(50) ;
5959
```
6060

61-
The following example generates a random number 4 bytes long using a 4-byte seed.
61+
This example generates a random number of length 4 bytes, using a 4-byte seed:
6262

6363
```sql
6464
SELECT CRYPT_GEN_RANDOM(4, 0x25F18060) ;

docs/t-sql/functions/cryptographic-functions-transact-sql.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ manager: craigg
2828
# Cryptographic functions (Transact-SQL)
2929
[!INCLUDE[tsql-appliesto-ss2008-asdb-xxxx-xxx-md](../../includes/tsql-appliesto-ss2008-asdb-xxxx-xxx-md.md)]
3030

31-
The following functions support encryption, decryption, digital signing, and the validation of digital signatures.
31+
These functions support digital signing, digital signature validation, encryption, and decryption.
3232

3333
## Symmetric encryption and decryption
3434

@@ -56,7 +56,7 @@ The following functions support encryption, decryption, digital signing, and the
5656
|[SIGNBYCERT](../../t-sql/functions/signbycert-transact-sql.md)|[VERIGYSIGNEDBYCERT](../../t-sql/functions/verifysignedbycert-transact-sql.md)|
5757
|[IS_OBJECTSIGNED](../../t-sql/functions/is-objectsigned-transact-sql.md)||
5858

59-
## Symmetric decryption with automatic key handling
59+
## Symmetric decryption, with automatic key handling
6060

6161
|||
6262
|-|-|
@@ -68,7 +68,7 @@ The following functions support encryption, decryption, digital signing, and the
6868
|-|-|
6969
|[HASHBYTES](../../t-sql/functions/hashbytes-transact-sql.md)||
7070

71-
## Copying certificates
71+
## Certificate copying
7272

7373
|||
7474
|-|-|

docs/t-sql/functions/cume-dist-transact-sql.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
title: "CUME_DIST (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
44
ms.date: "07/24/2017"
@@ -28,7 +28,7 @@ monikerRange: "= azuresqldb-current || = azure-sqldw-latest || >= sql-server-201
2828
# CUME_DIST (Transact-SQL)
2929
[!INCLUDE[tsql-appliesto-ss2012-asdb-asdw-xxx-md](../../includes/tsql-appliesto-ss2012-asdb-asdw-xxx-md.md)]
3030

31-
Calculates the cumulative distribution of a value in a group of values in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. That is, CUME_DIST computes the relative position of a specified value in a group of values. For a row *r*, assuming ascending ordering, the CUME_DIST of *r* is the number of rows with values lower than or equal to the value of *r*, divided by the number of rows evaluated in the partition or query result set. CUME_DIST is similar to the PERCENT_RANK function.
31+
For [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], this function calculates the cumulative distribution of a value within a group of values. In other words, `CUME_DIST` calculates the relative position of a specified value in a group of values. Assuming ascending ordering, the `CUME_DIST` of a value in row *r* is defined as the number of rows with values less than or equal to that value in row *r*, divided by the number of rows evaluated in the partition or query result set. `CUME_DIST` is similar to the `PERCENT_RANK` function.
3232

3333
![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
3434

@@ -41,19 +41,20 @@ CUME_DIST( )
4141
```
4242

4343
## Arguments
44-
OVER **(** [ *partition_by_clause* ] *order_by_clause***)**
45-
*partition_by_clause* divides the result set produced by the FROM clause into partitions to which the function is applied. If not specified, the function treats all rows of the query result set as a single group. *order_by_clause* determines the logical order in which the operation is performed. *order_by_clause* is required. The \<rows or range clause> of the OVER syntax cannot be specified in a CUME_DIST function. For more information, see [OVER Clause &#40;Transact-SQL&#41;](../../t-sql/queries/select-over-clause-transact-sql.md).
44+
OVER **(** [ *partition_by_clause* ] *order_by_clause*)
45+
46+
The *partition_by_clause* divides the FROM clause result set into partitions, to which the function is applied. If the *partition_by_clause* argument is not specified, `CUME_DIST` treats all query result set rows as a single group. The *order_by_clause* determines the logical order in which the operation occurs. `CUME_DIST` requires the *order_by_clause*. `CUME_DIST` will not accept the \<rows or range clause> of the OVER syntax. See [OVER Clause &#40;Transact-SQL&#41;](../../t-sql/queries/select-over-clause-transact-sql.md) for more information.
4647

4748
## Return types
4849
**float(53)**
4950

5051
## Remarks
51-
The range of values returned by CUME_DIST is greater than 0 and less than or equal to 1. Tie values always evaluate to the same cumulative distribution value. NULL values are included by default and are treated as the lowest possible values.
52+
`CUME_DIST` returns a range of values greater tnan 0 and less than or equal to 1. Tie values always evaluate to the same cumulative distribution value. `CUME_DIST` includes NULL values by default and treats these values as the lowest possible values.
5253

53-
CUME_DIST is nondeterministic. For more information, see [Deterministic and Nondeterministic Functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md).
54+
`CUME_DIST` is nondeterministic. See [Deterministic and Nondeterministic Functions](../../relational-databases/user-defined-functions/deterministic-and-nondeterministic-functions.md) for more information.
5455

5556
## Examples
56-
The following example uses the CUME_DIST function to compute the salary percentile for each employee within a given department. The value returned by the CUME_DIST function represents the percent of employees that have a salary less than or equal to the current employee in the same department. The PERCENT_RANK function computes the percent rank of the employee's salary within a department. The PARTITION BY clause is specified to partition the rows in the result set by department. The ORDER BY clause in the OVER clause logically orders the rows in each partition. The ORDER BY clause in the SELECT statement determines the display order of the result set.
57+
This example uses the `CUME_DIST` function to calculate the salary percentile for each employee within a given department. `CUME_DIST` returns a value that represents the percent of employees with a salary less than or equal to the current employee in the same department. The `PERCENT_RANK` function calculates the percent rank of the employee's salary within a department. To partition the result set rows by department, the example specifies the *partition_by_clause* value. The ORDER BY clause of the OVER clause logically orders the rows in each partition. The ORDER BY clause of the SELECT statement determines the display order of the result set.
5758

5859
```sql
5960
USE AdventureWorks2012;

docs/t-sql/functions/current-request-id-transact-sql.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ manager: craigg
2626
# CURRENT_REQUEST_ID (Transact-SQL)
2727
[!INCLUDE[tsql-appliesto-ss2008-xxxx-xxxx-xxx-md](../../includes/tsql-appliesto-ss2008-xxxx-xxxx-xxx-md.md)]
2828

29-
Returns the ID of the current request within the current session.
29+
This function returns the ID of the current request within the current session.
3030

3131
![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
3232

@@ -40,7 +40,7 @@ CURRENT_REQUEST_ID()
4040
**smallint**
4141

4242
## Remarks
43-
To find exact information about the current session and current request, use @@SPID and CURRENT_REQUEST_ID(), respectively.
43+
To find exact information about the current session, use @@SPID. For exact information about the current request, use CURRENT_REQUEST_ID().
4444

4545
## See also
4646
[@@SPID &#40;Transact-SQL&#41;](../../t-sql/functions/spid-transact-sql.md)

0 commit comments

Comments
 (0)