Skip to content

Commit 0f81b36

Browse files
Update Data Types.md
1 parent 535dcd3 commit 0f81b36

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

Articles/Data Types.md

+36-36
Original file line numberDiff line numberDiff line change
@@ -21,57 +21,57 @@
2121
-----
2222

2323
### Date and Time
24-
| Data Type | Time Precision | Range | Storage |
25-
|-------------------|------------------------------------------------------------------------------------------|-------------------------------------------------------------|-----------|
26-
| date | None | Year 1 to 9999 | 3 Bytes |
27-
| datetime | To a 1/300th of a second (0.003) | Year 1753 to 9999 | 8 Bytes |
28-
| datetime2(n) | Up to 7 decimal places (0.0000001 seconds) | Year 1 to 9999 | 6-8 Bytes |
29-
| datetimeoffset(n) | Up to 7 decimal places (0.0000001 seconds), with offset between -12:59 to +14:00 | Year 1 to 9999 | 8-10 Bytes|
30-
| smalldatetime | To the nearest minute | Year 1900 to 2079 | 4 Bytes |
31-
| time(n) | Up to 7 decimal places (0.0000001 seconds) | None | 3-5 Bytes |
24+
| Data Type | Time Precision | Range | Storage |
25+
|-------------------|------------------------------------------------------------------------------------------|-------------------------------------------------------------|------------|
26+
| date | None | Year 1 to 9999 | 3 Bytes |
27+
| datetime | To a 1/300th of a second (0.003) | Year 1753 to 9999 | 8 Bytes |
28+
| datetime2(n) | Up to 7 decimal places (0.0000001 seconds) | Year 1 to 9999 | 6-8 Bytes |
29+
| datetimeoffset(n) | Up to 7 decimal places (0.0000001 seconds), with offset between -12:59 to +14:00 | Year 1 to 9999 | 8-10 Bytes |
30+
| smalldatetime | To the nearest minute | Year 1900 to 2079 | 4 Bytes |
31+
| time(n) | Up to 7 decimal places (0.0000001 seconds) | None | 3-5 Bytes |
3232

3333
-----
3434

3535
### Character Strings
3636

37-
| Data Type | Characters | Storage | Note |
38-
|--------------|-----------------------------------|---------------|-------------------------------|
39-
| char(n) | UTF-8; 1-8000 characters | n Bytes | |
40-
| varchar(n) | UTF-8; 1-8000 characters | Char+2 Bytes | |
41-
| text | UTF-8; 1-2,147,483,647 characters| Variable | Deprecated, use varchar |
42-
| varchar(max) | UTF-8; 1-2,147,483,647 characters| Variable | |
37+
| Data Type | Characters | Storage | Note |
38+
|--------------|-----------------------------------|--------------|-------------------------|
39+
| char(n) | UTF-8; 1-8000 characters | n Bytes | |
40+
| varchar(n) | UTF-8; 1-8000 characters | Char+2 Bytes | |
41+
| text | UTF-8; 1-2,147,483,647 characters | Variable | Deprecated, use varchar |
42+
| varchar(max) | UTF-8; 1-2,147,483,647 characters | Variable | |
4343

4444
-----
4545

4646
### Unicode Character Strings
4747

48-
| Data Type | Characters | Storage | Note |
49-
|--------------|-----------------------------------------|---------------|------------------------------|
50-
| nchar(n) | Unicode; 1-4000 characters | 2n Bytes | |
51-
| nvarchar(n) | Unicode; 1-4000 characters | 2Char+2 Bytes | |
52-
| ntext | Unicode; 1-1,073,741,823 characters | 2Char Bytes | Deprecated |
53-
| nvarchar(max)| Unicode; 1-1,073,741,823 characters | 2Char Bytes | |
48+
| Data Type | Characters | Storage | Note |
49+
|---------------|-----------------------------------------|---------------|------------------------------|
50+
| nchar(n) | Unicode; 1-4000 characters | 2n Bytes | |
51+
| nvarchar(n) | Unicode; 1-4000 characters | 2Char+2 Bytes | |
52+
| ntext | Unicode; 1-1,073,741,823 characters | 2Char Bytes | Deprecated |
53+
| nvarchar(max) | Unicode; 1-1,073,741,823 characters | 2Char Bytes | |
5454

5555
-----
5656

5757
### Binary Strings
58-
| Data Type | Use When |
59-
|----------------|------------------------|
60-
| binary | Sizes are consistent |
61-
| varbinary | Sizes vary considerably|
62-
| varbinary(max) | More than 8000 bytes |
58+
| Data Type | Use When |
59+
|----------------|-------------------------|
60+
| binary | Sizes are consistent |
61+
| varbinary | Sizes vary considerably |
62+
| varbinary(max) | More than 8000 bytes |
6363

6464
-----
6565

6666
### Other Data Types
67-
| Data Type | Note |
68-
|------------------|-------------------------------------------|
69-
| cursor | |
70-
| geography | |
71-
| geometry | |
72-
| hierarchyid | |
73-
| rowversion | |
74-
| sql_variant | |
75-
| table | |
76-
| uniqueidentifier | Unique value using NEWID or NEWSEQUENTIALID|
77-
| XML | |
67+
| Data Type | Note |
68+
|------------------|---------------------------------------------|
69+
| cursor | |
70+
| geography | |
71+
| geometry | |
72+
| hierarchyid | |
73+
| rowversion | |
74+
| sql_variant | |
75+
| table | |
76+
| uniqueidentifier | Unique value using NEWID or NEWSEQUENTIALID |
77+
| XML | |

0 commit comments

Comments
 (0)