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

Commit 448fa72

Browse files
authored
Merge pull request #9121 from WilliamAntonRohm/t-sql-under80
T-SQL articles -- improving Acrolinx scores -- batch #7
2 parents 57b919a + 4ffa4ef commit 448fa72

7 files changed

Lines changed: 54 additions & 61 deletions

File tree

docs/t-sql/data-types/smalldatetime-transact-sql.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,26 @@ Defines a date that is combined with a time of day. The time is based on a 24-ho
4141
|Default string literal formats<br /><br /> (used for down-level client)|Not applicable|
4242
|Date range|1900-01-01 through 2079-06-06<br /><br /> January 1, 1900, through June 6, 2079|
4343
|Time range|00:00:00 through 23:59:59<br /><br /> 2007-05-09 23:59:59 will round to<br /><br /> 2007-05-10 00:00:00|
44-
|Element ranges|YYYY is four digits, ranging from 1900, to 2079, that represent a year.<br /><br /> MM is two digits, ranging from 01 to 12, that represent a month in the specified year.<br /><br /> DD is two digits, ranging from 01 to 31 depending on the month, that represent a day of the specified month.<br /><br /> hh is two digits, ranging from 00 to 23, that represent the hour.<br /><br /> mm is two digits, ranging from 00 to 59, that represent the minute.<br /><br /> ss is two digits, ranging from 00 to 59, that represent the second. Values that are 29.998 seconds or less are rounded down to the nearest minute, Values of 29.999 seconds or more are rounded up to the nearest minute.|
44+
|Element ranges|YYYY is four digits, ranging from 1900, to 2079, that represent a year.<br /><br /> MM is two digits, ranging from 01 to 12, that represent a month in the specified year.<br /><br /> DD is two digits, ranging from 01 to 31 depending on the month, that represent a day of the specified month.<br /><br /> hh is two digits, ranging from 00 to 23, that represent the hour.<br /><br /> mm is two digits, ranging from 00 to 59, that represent the minute.<br /><br /> ss is two digits, ranging from 00 to 59, that represent the second. Values that are 29.998 seconds or less are rounded down to the nearest minute. Values of 29.999 seconds or more are rounded up to the nearest minute.|
4545
|Character length|19 positions maximum|
4646
|Storage size|4 bytes, fixed.|
4747
|Accuracy|One minute|
4848
|Default value|1900-01-01 00:00:00|
49-
|Calendar|Gregorian<br /><br /> (Does not include the complete range of years.)|
49+
|Calendar|Gregorian<br /><br /> (Doesn't include the complete range of years.)|
5050
|User-defined fractional second precision|No|
5151
|Time zone offset aware and preservation|No|
5252
|Daylight saving aware|No|
5353

5454
## ANSI and ISO 8601 Compliance
55-
**smalldatetime** is not ANSI or ISO 8601 compliant.
55+
**smalldatetime** isn't ANSI or ISO 8601 compliant.
5656

5757
## Converting date and time data
58-
When you convert to date and time data types, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] rejects all values it cannot recognize as dates or times. For information about using the CAST and CONVERT functions with date and time data, see [CAST and CONVERT &#40;Transact-SQL&#41;](../../t-sql/functions/cast-and-convert-transact-sql.md).
58+
When you convert to date and time data types, [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] rejects all values it can't recognize as dates or times. For information about using the CAST and CONVERT functions with date and time data, see [CAST and CONVERT &#40;Transact-SQL&#41;](../../t-sql/functions/cast-and-convert-transact-sql.md).
5959

6060
### Converting smalldatetime to other date and time types
6161
This section describes what occurs when a **smalldatetime** data type is converted to other date and time data types.
6262

63-
In the case of conversion to **date**, the year, month, and day are copied. The following code shows the results of converting a `smalldatetime` value to a `date` value.
63+
For a conversion to **date**, the year, month, and day are copied. The following code shows the results of converting a `smalldatetime` value to a `date` value.
6464

6565
```sql
6666
DECLARE @smalldatetime smalldatetime = '1955-12-13 12:43:10';
@@ -108,7 +108,7 @@ SELECT @smalldatetime AS '@smalldatetime', @datetime AS 'datetime';
108108
--(1 row(s) affected)
109109
```
110110

111-
In the case of conversion to **datetimeoffset(n)**, the **smalldatetime** value is copied to the **datetimeoffset(n)** value. The fractional seconds are set to 0, and the time zone offset is set to +00:0. The following code shows the results of converting a `smalldatetime` value to a `datetimeoffset(4)` value.
111+
For a conversion to **datetimeoffset(n)**, the **smalldatetime** value is copied to the **datetimeoffset(n)** value. The fractional seconds are set to 0, and the time zone offset is set to +00:0. The following code shows the results of converting a `smalldatetime` value to a `datetimeoffset(4)` value.
112112

113113
```sql
114114
DECLARE @smalldatetime smalldatetime = '1955-12-13 12:43:10';
@@ -185,5 +185,4 @@ SELECT
185185

186186
## See also
187187
[CAST and CONVERT &#40;Transact-SQL&#41;](../../t-sql/functions/cast-and-convert-transact-sql.md)
188-
189-
188+

docs/t-sql/database-console-commands/dbcc-checkident-transact-sql.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ manager: craigg
3333
# DBCC CHECKIDENT (Transact-SQL)
3434
[!INCLUDE[tsql-appliesto-ss2008-asdb-asdw-xxx-md](../../includes/tsql-appliesto-ss2008-asdb-asdw-xxx-md.md)]
3535

36-
Checks the current identity value for the specified table in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)] and, if it is needed, changes the identity value. You can also use DBCC CHECKIDENT to manually set a new current identity value for the identity column.
36+
Checks the current identity value for the specified table in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)] and, if it's needed, changes the identity value. You can also use DBCC CHECKIDENT to manually set a new current identity value for the identity column.
3737

3838

39-
![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)
39+
![Article link icon](../../database-engine/configure-windows/media/topic-link.gif "Article link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
4040

4141
## Syntax
4242

@@ -52,10 +52,10 @@ DBCC CHECKIDENT
5252

5353
## Arguments
5454
*table_name*
55-
Is the name of the table for which to check the current identity value. The table specified must contain an identity column. Table names must comply with the rules for [identifiers](../../relational-databases/databases/database-identifiers.md). Two or three part names must be delimited, such as 'Person.AddressType' or [Person.AddressType].
55+
Is the name of the table for which to check the current identity value. The table specified must contain an identity column. Table names must follow the rules for [identifiers](../../relational-databases/databases/database-identifiers.md). Two or three part names must be delimited, such as 'Person.AddressType' or [Person.AddressType].
5656

5757
NORESEED
58-
Specifies that the current identity value should not be changed.
58+
Specifies that the current identity value shouldn't be changed.
5959

6060
RESEED
6161
Specifies that the current identity value should be changed.
@@ -71,31 +71,31 @@ DBCC CHECKIDENT
7171

7272
|DBCC CHECKIDENT command|Identity correction or corrections made|
7373
|-----------------------------|---------------------------------------------|
74-
|DBCC CHECKIDENT ( *table_name*, NORESEED )|Current identity value is not reset. DBCC CHECKIDENT returns the current identity value and the current maximum value of the identity column. If the two values are not the same, you should reset the identity value to avoid potential errors or gaps in the sequence of values.|
75-
|DBCC CHECKIDENT ( *table_name* )<br /><br /> or<br /><br /> DBCC CHECKIDENT ( *table_name*, RESEED )|If the current identity value for a table is less than the maximum identity value stored in the identity column, it is reset using the maximum value in the identity column. See the 'Exceptions' section that follows.|
76-
|DBCC CHECKIDENT ( *table_name*, RESEED, *new_reseed_value* )|Current identity value is set to the *new_reseed_value*. If no rows have been inserted into the table since the table was created, or if all rows have been removed by using the TRUNCATE TABLE statement, the first row inserted after you run DBCC CHECKIDENT uses *new_reseed_value* as the identity.<br /><br /> If rows are present in the table, the next row is inserted with the *new_reseed_value* + the [current increment](../../t-sql/functions/ident-incr-transact-sql.md) value. In version [!INCLUDE[ssKilimanjaro](../../includes/sskilimanjaro-md.md)] and earlier, the next row inserted uses *new_reseed_value* + the [current increment](../../t-sql/functions/ident-incr-transact-sql.md) value.<br /><br /> If the table is not empty, setting the identity value to a number less than the maximum value in the identity column can result in one of the following conditions:<br /><br /> -If a PRIMARY KEY or UNIQUE constraint exists on the identity column, error message 2627 will be generated on later insert operations into the table because the generated identity value will conflict with existing values.<br /><br /> -If a PRIMARY KEY or UNIQUE constraint does not exist, later insert operations will result in duplicate identity values.|
74+
|DBCC CHECKIDENT ( *table_name*, NORESEED )|Current identity value isn't reset. DBCC CHECKIDENT returns the current identity value and the current maximum value of the identity column. If the two values aren't the same, you should reset the identity value to avoid potential errors or gaps in the sequence of values.|
75+
|DBCC CHECKIDENT ( *table_name* )<br /><br /> or<br /><br /> DBCC CHECKIDENT ( *table_name*, RESEED )|If the current identity value for a table is less than the maximum identity value stored in the identity column, it's reset using the maximum value in the identity column. See the 'Exceptions' section that follows.|
76+
|DBCC CHECKIDENT ( *table_name*, RESEED, *new_reseed_value* )|Current identity value is set to the *new_reseed_value*. If no rows were inserted into the table since the table was created, or if all rows were removed by using the TRUNCATE TABLE statement, the first row inserted after you run DBCC CHECKIDENT uses *new_reseed_value* as the identity.<br /><br /> If rows are present in the table, the next row is inserted with the *new_reseed_value* + the [current increment](../../t-sql/functions/ident-incr-transact-sql.md) value. In version [!INCLUDE[ssKilimanjaro](../../includes/sskilimanjaro-md.md)] and earlier, the next row inserted uses *new_reseed_value* + the [current increment](../../t-sql/functions/ident-incr-transact-sql.md) value.<br /><br /> If the table isn't empty, setting the identity value to a number less than the maximum value in the identity column can result in one of the following conditions:<br /><br /> -If a PRIMARY KEY or UNIQUE constraint exists on the identity column, error message 2627 will be generated on later insert operations into the table. This error is because the generated identity value will conflict with existing values.<br /><br /> -If a PRIMARY KEY or UNIQUE constraint doesn't exist, later insert operations will result in duplicate identity values.|
7777

7878
## Exceptions
79-
The following table lists conditions when DBCC CHECKIDENT does not automatically reset the current identity value and provides methods for resetting the value.
79+
The following table lists conditions when DBCC CHECKIDENT doesn't automatically reset the current identity value, and provides methods for resetting the value.
8080

8181
|Condition|Reset methods|
8282
|---------------|-------------------|
83-
|The current identity value is larger than the maximum value in the table.|Execute DBCC CHECKIDENT (*table_name*, NORESEED) to determine the current maximum value in the column, and then specify that value as the *new_reseed_value* in a DBCC CHECKIDENT (*table_name*, RESEED,*new_reseed_value*) command.<br /><br /> -OR-<br /><br /> Execute DBCC CHECKIDENT (*table_name*, RESEED,*new_reseed_value*) with *new_reseed_value* set to a very low value, and then run DBCC CHECKIDENT (*table_name*, RESEED) to correct the value.|
84-
|All rows are deleted from the table.|Execute DBCC CHECKIDENT (*table_name*, RESEED,*new_reseed_value*) with *new_reseed_value* set to the desired starting value.|
83+
|The current identity value is larger than the maximum value in the table.|Execute DBCC CHECKIDENT (*table_name*, NORESEED) to determine the current maximum value in the column. Next, specify that value as the *new_reseed_value* in a DBCC CHECKIDENT (*table_name*, RESEED,*new_reseed_value*) command.<br /><br /> -OR-<br /><br /> Execute DBCC CHECKIDENT (*table_name*, RESEED,*new_reseed_value*) with *new_reseed_value* set to a very low value, and then run DBCC CHECKIDENT (*table_name*, RESEED) to correct the value.|
84+
|All rows are deleted from the table.|Execute DBCC CHECKIDENT (*table_name*, RESEED,*new_reseed_value*) with *new_reseed_value* set to the new starting value.|
8585

8686
## Changing the Seed Value
87-
The seed value is the value inserted into an identity column for the very first row loaded into the table. All subsequent rows contain the current identity value plus the increment value where current identity value is the last identity value generated for the table or view.
87+
The seed value is the value inserted into an identity column for the first row loaded into the table. All subsequent rows contain the current identity value plus the increment value where current identity value is the last identity value generated for the table or view.
8888

89-
You cannot use DBCC CHECKIDENT to perform the following tasks:
89+
You can't use DBCC CHECKIDENT for the following tasks:
9090

91-
- Change the original seed value that was specified for an identity column when the table or view was created.
91+
- Change the original seed value specified for an identity column when the table or view was created.
9292

9393
- Reseed existing rows in a table or view.
9494

95-
To change the original seed value and reseed any existing rows, you must drop the identity column and recreate it specifying the new seed value. When the table contains data, the identity numbers are added to the existing rows with the specified seed and increment values. The order in which the rows are updated is not guaranteed.
95+
To change the original seed value and reseed any existing rows, drop the identity column and recreate it specifying the new seed value. When the table contains data, the identity numbers are added to the existing rows with the specified seed and increment values. The order in which the rows are updated isn't guaranteed.
9696

9797
## Result Sets
98-
Whether or not any of the options are specified for a table that contains an identity column, DBCC CHECKIDENT returns the following message for all operations except when specifying a new seed value.
98+
Whether or not you specify any options for a table that contains an identity column, DBCC CHECKIDENT returns the following message for all operations except one. That operation is specifying a new seed value.
9999

100100
`Checking identity information: current identity value '\<current identity value>', current column value '\<current column value>'. DBCC execution completed. If DBCC printed error messages, contact your system administrator.`
101101

@@ -108,8 +108,8 @@ DBCC CHECKIDENT
108108

109109
## Examples
110110

111-
### A. Resetting the current identity value, if it is needed
112-
The following example resets the current identity value, if it is needed, of the specified table in the [!INCLUDE[ssSampleDBobject](../../includes/sssampledbobject-md.md)] database.
111+
### A. Resetting the current identity value, if it's needed
112+
The following example resets the current identity value, if it's needed, of the specified table in the [!INCLUDE[ssSampleDBobject](../../includes/sssampledbobject-md.md)] database.
113113

114114
```
115115
USE AdventureWorks2012;
@@ -119,7 +119,7 @@ GO
119119
```
120120

121121
### B. Reporting the current identity value
122-
The following example reports the current identity value in the specified table in the [!INCLUDE[ssSampleDBobject](../../includes/sssampledbobject-md.md)] database, and does not correct the identity value if it is incorrect.
122+
The following example reports the current identity value in the specified table in the [!INCLUDE[ssSampleDBobject](../../includes/sssampledbobject-md.md)] database, and doesn't correct the identity value if it's incorrect.
123123

124124
```
125125
USE AdventureWorks2012;
@@ -161,5 +161,4 @@ GO
161161
[USE &#40;Transact-SQL&#41;](../../t-sql/language-elements/use-transact-sql.md)
162162
[IDENT_SEED &#40;Transact-SQL&#41;](../../t-sql/functions/ident-seed-transact-sql.md)
163163
[IDENT_INCR &#40;Transact-SQL&#41;](../../t-sql/functions/ident-incr-transact-sql.md)
164-
165-
164+

docs/t-sql/database-console-commands/dbcc-pdw-showpartitionstats-transact-sql.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ monikerRange: ">= aps-pdw-2016 || = azure-sqldw-latest || = sqlallproducts-allve
1818

1919
Displays the size and number of rows for each partition of a table in a [!INCLUDE[ssSDW](../../includes/sssdw-md.md)] or [!INCLUDE[ssPDW](../../includes/sspdw-md.md)] database.
2020

21-
![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions &#40;Transact-SQL&#41;](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
21+
![Article link icon](../../database-engine/configure-windows/media/topic-link.gif "Article link icon") [Transact-SQL Syntax Conventions &#40;Transact-SQL&#41;](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
2222

2323
## Syntax
2424

@@ -36,16 +36,16 @@ DBCC PDW_SHOWPARTITIONSTATS ( " [ database_name . [ schema_name ] . ] | [ schema
3636
Requires **VIEW SERVER STATE** permission.
3737

3838
## Result Sets
39-
This is the results for the DBCC PDW_SHOWPARTITIONSTATS command.
39+
This set is the results for the DBCC PDW_SHOWPARTITIONSTATS command.
4040

4141
|Column Name|Data Type|Description|
4242
|-----------------|---------------|-----------------|
4343
|partition_number|int|Partition number.|
4444
|used_page_count|bigint|Number of pages used for the data.|
45-
|reserved_page_count|bigint|Number of pages allocated to the partition.|
45+
|reserved_page_count|bigint|Number of pages reserved for the partition.|
4646
|row_count|bigint|Number of rows in the partition.|
4747
|pdw_node_id|int|Compute node for the data.|
48-
|distribution_id|int|Distribution id for the data.|
48+
|distribution_id|int|Distribution identifier for the data.|
4949

5050
## Examples: [!INCLUDE[ssSDW](../../includes/sssdw-md.md)] and [!INCLUDE[ssPDW](../../includes/sspdw-md.md)]
5151
### A. DBCC PDW_SHOWPARTITIONSTATS Basic Syntax Examples
@@ -59,4 +59,4 @@ DBCC PDW_SHOWPARTITIONSTATS (FactInternetSales);
5959
## See also
6060
[DBCC PDW_SHOWEXECUTIONPLAN &#40;Transact-SQL&#41;](dbcc-pdw-showexecutionplan-transact-sql.md)
6161
[DBCC PDW_SHOWSPACEUSED &#40;Transact-SQL&#41;](dbcc-pdw-showspaceused-transact-sql.md)
62-
62+

0 commit comments

Comments
 (0)