Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 1d42fec

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

2 files changed

Lines changed: 23 additions & 11 deletions

File tree

docs/linux/sql-server-linux-configure-environment-variables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ You can use several different environment variables to configure SQL Server 2017
4848
| **MSSQL_AGENT_ENABLED** | Enable SQL Server Agent. For example, 'true' is enabled and 'false' is disabled. By default, agent is disabled. |
4949
| **MSSQL_MASTER_DATA_FILE** | Sets the location of the master database data file. |
5050
| **MSSQL_MASTER_LOG_FILE** | Sets the location of the master database log file. |
51+
| **MSSQL_ERROR_LOG_FILE** | Sets the location of the errorlog files. |
5152

5253

5354
## Example: initial setup

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

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
title: "CHECKSUM (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
44
ms.date: "07/24/2017"
@@ -28,11 +28,12 @@ ms.author: "edmaca"
2828
manager: "craigg"
2929
ms.workload: "Active"
3030
monikerRange: "= azuresqldb-current || = azure-sqldw-latest || >= sql-server-2016 || = sqlallproducts-allversions"
31+
3132
---
3233
# CHECKSUM (Transact-SQL)
3334
[!INCLUDE[tsql-appliesto-ss2008-asdb-asdw-xxx-md](../../includes/tsql-appliesto-ss2008-asdb-asdw-xxx-md.md)]
3435

35-
Returns the checksum value computed over a row of a table, or over a list of expressions. CHECKSUM is intended for use in building hash indexes.
36+
The `CHECKSUM` function returns the checksum value computed over a table row, or over an expression list. Use `CHECKSUM` to build hash indexes.
3637

3738
![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)
3839

@@ -44,25 +45,35 @@ CHECKSUM ( * | expression [ ,...n ] )
4445

4546
## Arguments
4647
\*
47-
Specifies that computation is over all the columns of the table. CHECKSUM returns an error if any column is of noncomparable data type. Noncomparable data types are **text**, **ntext**, **image**, XML, and **cursor**, and also **sql_variant** with any one of the preceding types as its base type.
48+
This argument specifies that the checksum computation covers all table columns. `CHECKSUM` returns an error if any column has a noncomparable data type. Noncomparable data types include:
49+
50+
- **cursor**
51+
- **image**
52+
- **ntext**
53+
- **text**
54+
- **XML**
55+
56+
Another noncomparable data type is **sql_variant** with any one of the preceding data types as its base type.
4857

4958
*expression*
50-
Is an [expression](../../t-sql/language-elements/expressions-transact-sql.md) of any type except a noncomparable data type.
59+
An [expression](../../t-sql/language-elements/expressions-transact-sql.md) of any type, except a noncomparable data type.
5160

5261
## Return types
5362
**int**
5463

5564
## Remarks
56-
CHECKSUM computes a hash value, called the checksum, over its list of arguments. The hash value is intended for use in building hash indexes. If the arguments to CHECKSUM are columns, and an index is built over the computed CHECKSUM value, the result is a hash index. This can be used for equality searches over the columns.
65+
CHECKSUM computes a hash value, called the checksum, over its argument list. Use this hash value to build hash indexes. A hash index will result if the `CHECKSUM` function has column arguments, and an index is built over the computed CHECKSUM value. This can be used for equality searches over the columns.
5766

58-
CHECKSUM satisfies the properties of a hash function: CHECKSUM applied over any two lists of expressions returns the same value if the corresponding elements of the two lists have the same type and are equal when compared using the equals (=) operator. For this definition, null values of a specified type are considered to compare as equal. If one of the values in the expression list changes, the checksum of the list also generally changes. However, there is a small chance that the checksum will not change. For this reason, we do not recommend using CHECKSUM to detect whether values have changed, unless your application can tolerate occasionally missing a change. Consider using [HashBytes](../../t-sql/functions/hashbytes-transact-sql.md) instead. When an MD5 hash algorithm is specified, the probability of HashBytes returning the same result for two different inputs is much lower than that of CHECKSUM.
67+
The `CHECKSUM` function satisfies hash function properties: `CHECKSUM` applied over any two lists of expressions will return the same value, if the corresponding elements of the two lists have the same data type, and if those corresponding elements have equality when compared using the equals (=) operator. Null values of a specified type are defined to compare as equal for `CHECKSUM` function purposes. If at least one of the values in the expression list changes, the list checksum will probably change. However, this is not guaranteed. Therefore, to detect whether values have changed, we recommend use of `CHECKSUM` only if your application can tolerate an occasional missed change. Otherwise, consider using [HashBytes](../../t-sql/functions/hashbytes-transact-sql.md) instead. With a specified MD5 hash algorithm, the probability that HashBytes will return the same result, for two different inputs, is much lower compared to CHECKSUM.
5968

60-
The order of expressions affects the resultant value of CHECKSUM. The order of columns used with CHECKSUM(*) is the order of columns specified in the table or view definition. This includes computed columns.
69+
The expression order affects the computed `CHECKSUM` value. The order of columns used for CHECKSUM(\*) is the order of columns specified in the table or view definition. This includes computed columns.
6170

62-
The CHECKSUM value is dependent upon the collation. The same value stored with a different collation will return a different CHECKSUM value.
71+
The CHECKSUM value depends on the collation. The same value stored with a different collation will return a different CHECKSUM value.
6372

6473
## Examples
65-
The following examples show using `CHECKSUM` to build hash indexes. The hash index is built by adding a computed checksum column to the table being indexed, and then building an index on the checksum column.
74+
These examples show the use of `CHECKSUM` to build hash indexes.
75+
76+
To build the hash index, the first example adds a computed checksum column to the table we want to index. It then builds an index on the checksum column.
6677

6778
```sql
6879
-- Create a checksum index.
@@ -76,7 +87,7 @@ CREATE INDEX Pname_index ON Production.Product (cs_Pname);
7687
GO
7788
```
7889

79-
The checksum index can be used as a hash index, particularly to improve indexing speed when the column to be indexed is a long character column. The checksum index can be used for equality searches.
90+
This example shows the use of a checksum index as a hash index. This can help improve indexing speed when the column to index is a long character column. The checksum index can be used for equality searches.
8091

8192
```sql
8293
/*Use the index in a SELECT query. Add a second search
@@ -89,7 +100,7 @@ AND Name = N'Bearing Ball';
89100
GO
90101
```
91102

92-
Creating the index on the computed column materializes the checksum column, and any changes to the `ProductName` value will be propagated to the checksum column. Alternatively, an index could be built directly on the column indexed. However, if the key values are long, a regular index is not likely to perform as well as a checksum index.
103+
Index creation on the computed column materializes the checksum column, and any changes to the `ProductName` value will propagate to the checksum column. Alternatively, we could build an index directly on the column we want to index. However, for long key values, a regular index will probably not perform as well as a checksum index.
93104

94105
## See also
95106
[CHECKSUM_AGG (Transact-SQL)](../../t-sql/functions/checksum-agg-transact-sql.md)

0 commit comments

Comments
 (0)