<commit_before>MS SQL Data
-----------

Types
~~~~~

.Datatypes
[options="header,autowidth"]
|===
| Family | name | since SQL# | bytes | lower bound | upper bound

.6+s| Date/Time | date | 2008 | 3 | 0001-01-01 | 9999-12-31

| datetime |  | 8
| 1753-01-01 00:00:00.000
| 9999-12-31 23:59:59.997

| datetime2[(s)] | 2008
a| [.small]#s < 3/5/8 = 6/7/8#
| 0001-01-01 00:00:00.0…
| 9999-12-31 23:59:59.9…

| datetimeoffset | 2008 | 10
a| [.small]#0001-01-01 00:00:00.0000000 -14:00#
a| [.small]#9999-12-31 23:59:59.9999999 +14:00#

| smalldatetime |  | 4 | 1900-01-01 00:00 | 2079-12-31 23:59

| time | 2008 | 5 | 00:00:00.0000000 | 23:59:59.9999999

.5+s| Integer | bigint | 2000 | 8
| -9,223,372,036,854,775,808
| 9,223,372,036,854,775,807

| bit |  | 1 | 0 | 1

| int |  | 4 | -2,147,483,648 | 2,147,483,647

| smallint |  | 2 | -32,768 | 32,767

| tinyint |  | 1 | 0 | 255

.2+s| Monetary | money |  | 8
| -922,337,203,685,477.5808
| 922,337,203,685,477.5807

| smallmoney |  | 4
| -214,748.3648
| 214,748.3647

.2+s| Approximate Numeric | float[(n)] |  | 8
2.10+|

| real |  | 4

.2+s| Exact Numeric | decimal[(p[,s])] |
.2+a| [.small]#p < 9/19/28/38 = 5/9/13/17#

| numeric[(p[,s])] |

.2+s| Binary | binary[(n)] |
a| [.small]#n ≤ 8,000#

| varbinary[(n)] |
a| [.small]#≤ n ≤ 8,000#

.4+s| Character | char[(n)] |
a| [.small]#n ≤ 8,000#

| nchar[(n)] | 7
a| [.small]#n × 2 ≤ 8,000#

| nvarchar[(n)] | 7
a| [.small]#≤ n × 2 ≤ 8,000#

| varchar[(n)] |
a| [.small]#≤ n ≤ 8,000#

.6+s| Long Text and Binary | image
a| [.small]#dep. 2005#
3.6+a|
* 16 byte in-row pointer to ≤ 2,147,483,647 bytes data.
* Max types are stored in-row up to 8,000 bytes.
* n(var)char/ntext are stored as UCS-2, two bytes per character.


| ntext
a| [.small]#7, dep. 2005#

| nvarchar(max) | 2005

| text
a| [.small]#dep. 2005#

| varbinary(max) | 2005

| varchar(max) | 2005

.6+s| Special | hierarchyid | 2008
3+a| [.small]#A slash-separated path: /1/3/#

| rowversion |  | 8 | |

| sql_variant | 2000
3+a| [.small]#Stores any datatype except long text, long binary, or special types (max 8016 bytes).#

| table | 2000
3+a| [.small]#Sometimes faster than temporary tables. declare @name table ( … table definition … )#

| uniqueidentifier | 7 | 16 | |

| xml | 2005
a| [.small]#16 (in-row pointer)#
2+a| [.small]#XML data with a schema is stored as a parsed tree.#
|===

Date Formats
~~~~~~~~~~~~

.+convert(varchar, @datetime, CODE)+
[options="header,footer,autowidth",frame="none",grid="none",stripes="even",cols=">1m,>1m,>1m,8,6"]
|===

2+| yyyy codes | yy code | format | name

| 0 | 100 | | MMM dd yyyy hh:mmtt | Default

| | 101 | 1 | MM/dd/yyyy | US

| | 102 | 2 | yyyy.MM.dd | ANSI

| | 103 | 3 | dd/MM/yyyy | British/French

| | 104 | 4 | dd.MM.yyyy | German

| | 105 | 5 | dd-MM-yyyy | Italian

| | 106 | 6 | dd MMM yyyy |

| | 107 | 7 | MMM dd, yyyy |<commit_msg>More table formatting<commit_after>MS SQL Data
-----------

Types
~~~~~

.Datatypes
[options="header,autowidth"]
|===
| Family | name | since SQL# | bytes | lower bound | upper bound

.6+s| Date/Time | date | 2008 | 3 | 0001-01-01 | 9999-12-31

| datetime |  | 8
| 1753-01-01 00:00:00.000
| 9999-12-31 23:59:59.997

| datetime2[(s)] | 2008
a| [.small]#s < 3/5/8 = 6/7/8#
| 0001-01-01 00:00:00.0…
| 9999-12-31 23:59:59.9…

| datetimeoffset | 2008 | 10
a| [.small]#0001-01-01 00:00:00.0000000 -14:00#
a| [.small]#9999-12-31 23:59:59.9999999 +14:00#

| smalldatetime |  | 4 | 1900-01-01 00:00 | 2079-12-31 23:59

| time | 2008 | 5 | 00:00:00.0000000 | 23:59:59.9999999

.5+s| Integer | bigint | 2000 | 8
| -9,223,372,036,854,775,808
| 9,223,372,036,854,775,807

| bit |  | 1 | 0 | 1

| int |  | 4 | -2,147,483,648 | 2,147,483,647

| smallint |  | 2 | -32,768 | 32,767

| tinyint |  | 1 | 0 | 255

.2+s| Monetary | money |  | 8
| -922,337,203,685,477.5808
| 922,337,203,685,477.5807

| smallmoney |  | 4
| -214,748.3648
| 214,748.3647

.2+s| Approximate Numeric | float[(n)] |  | 8
2.10+|

| real |  | 4

.2+s| Exact Numeric | decimal[(p[,s])] |
.2+a| [.small]#p < 9/19/28/38 = 5/9/13/17#

| numeric[(p[,s])] |

.2+s| Binary | binary[(n)] |
a| [.small]#n ≤ 8,000#

| varbinary[(n)] |
a| [.small]#≤ n ≤ 8,000#

.4+s| Character | char[(n)] |
a| [.small]#n ≤ 8,000#

| nchar[(n)] | 7
a| [.small]#n × 2 ≤ 8,000#

| nvarchar[(n)] | 7
a| [.small]#≤ n × 2 ≤ 8,000#

| varchar[(n)] |
a| [.small]#≤ n ≤ 8,000#

.6+s| Long Text and Binary | image
a| [.small]#dep. 2005#
3.6+a|
* 16 byte in-row pointer to ≤ 2,147,483,647 bytes data.
* Max types are stored in-row up to 8,000 bytes.
* n(var)char/ntext are stored as UCS-2, two bytes per character.


| ntext
a| [.small]#7, dep. 2005#

| nvarchar(max) | 2005

| text
a| [.small]#dep. 2005#

| varbinary(max) | 2005

| varchar(max) | 2005

.6+s| Special | hierarchyid | 2008
3+a| [.small]#A slash-separated path: /1/3/#

| rowversion |  | 8 | |

| sql_variant | 2000
3+a| [.small]#Stores any datatype except long text, long binary, or special types (max 8016 bytes).#

| table | 2000
3+a| [.small]#Sometimes faster than temporary tables. declare @name table ( … table definition … )#

| uniqueidentifier | 7 | 16 | |

| xml | 2005
a| [.small]#16 (in-row pointer)#
2+a| [.small]#XML data with a schema is stored as a parsed tree.#
|===

Date Formats
~~~~~~~~~~~~

.+convert(varchar, @datetime, CODE)+
[options="header,footer,autowidth",frame="none",grid="none",stripes="even",cols=">1m,>1m,>1m,8,6"]
|===

2+| yyyy codes | yy code <| format | name

| 0 | 100 | | MMM dd yyyy hh:mmtt | Default

| | 101 | 1 | MM/dd/yyyy | US

| | 102 | 2 | yyyy.MM.dd | ANSI

| | 103 | 3 | dd/MM/yyyy | British/French

| | 104 | 4 | dd.MM.yyyy | German

| | 105 | 5 | dd-MM-yyyy | Italian

| | 106 | 6 | dd MMM yyyy |

| | 107 | 7 | MMM dd, yyyy |
{'fraction_non_alphanumeric': 0.2200245055137406, 'fraction_numerical': 0.18274111675126903, 'mean_word_length': 3.229459659511473, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 8, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1620039', 'n_tokens_mistral': 3383, 'n_tokens_neox': 2587, 'n_words': 640}