Skip to content

Commit 2546b02

Browse files
authored
Update nchar-transact-sql.md
1 parent 45135cc commit 2546b02

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ NCHAR ( integer_expression )
3636

3737
## Arguments
3838
*integer_expression*
39-
When the collation of the database does not contain the supplementary character (SC) flag, this is a positive whole number from 0 through 65535 (0 through 0xFFFF). If a value outside this range is specified, NULL is returned. For more information about supplementary characters, see [Collation and Unicode Support](../../relational-databases/collations/collation-and-unicode-support.md).
39+
When the collation of the database does not contain the [Supplementary Character (SC)](../../relational-databases/collations/collation-and-unicode-support.md#Supplementary_Characters) flag, this is a positive integer from 0 through 65535 (0 through 0xFFFF). If a value outside this range is specified, NULL is returned. For more information about supplementary characters, see [Collation and Unicode Support](../../relational-databases/collations/collation-and-unicode-support.md).
4040

41-
When the collation of the database supports the supplementary character (SC) flag, this is a positive whole number from 0 through 1114111 (0 through 0x10FFFF). If a value outside this range is specified, NULL is returned.
41+
When the collation of the database supports the SC flag, this is a positive integer from 0 through 1114111 (0 through 0x10FFFF). If a value outside this range is specified, NULL is returned.
4242

4343
## Return Types
4444
**nchar(1)** when the default database collation does not support supplementary characters.
@@ -47,7 +47,7 @@ NCHAR ( integer_expression )
4747

4848
If the parameter *integer_expression* lies in the range 0 - 0xFFFF, only one character is returned. For higher values, NCHAR returns the corresponding surrogate pair. Do not construct a surrogate pair by using `NCHAR(<High surrogate>) + NCHAR(\<Low Surrogate>)`. Instead, use a database collation that supports supplementary characters and then specify the Unicode codepoint for the surrogate pair. The following example demonstrates both the old style method of constructing a surrogate pair and the preferred method of specifying the Unicode codepoint.
4949

50-
```
50+
```sql
5151
CREATE DATABASE test COLLATE Finnish_Swedish_100_CS_AS_SC;
5252
DECLARE @d nvarchar(10) = N'𣅿';
5353
-- Old style method.
@@ -65,7 +65,7 @@ SELECT NCHAR(UNICODE(@d));
6565
### A. Using NCHAR and UNICODE
6666
The following example uses the `UNICODE` and `NCHAR` functions to print the `UNICODE` value and the `NCHAR` (Unicode character) of the second character of the `København` character string, and to print the actual second character, `ø`.
6767

68-
```
68+
```sql
6969
DECLARE @nstring nchar(8);
7070
SET @nstring = N'København';
7171
SELECT UNICODE(SUBSTRING(@nstring, 2, 1)),
@@ -84,7 +84,7 @@ GO
8484
### B. Using SUBSTRING, UNICODE, CONVERT, and NCHAR
8585
The following example uses the `SUBSTRING`, `UNICODE`, `CONVERT`, and `NCHAR` functions to print the character number, the Unicode character, and the UNICODE value of each character in the string `København`.
8686

87-
```
87+
```sql
8888
-- The @position variable holds the position of the character currently
8989
-- being processed. The @nstring variable is the Unicode character
9090
-- string to process.

0 commit comments

Comments
 (0)