Namespace : CA.Blocks.SQLServerDataAccess
Assembly : CA.Blocks.SQLServerDataAccess.dll
When going from the .NET world info the database we need to tell the database the the precision on which to store the DateTime. SQL server exposes four levels
Name | Value | Description |
---|---|---|
Date | 0 | Will only store the date value of the DateTime Input, is is accurate to the day and uses 3 bytes of storage. |
DateTime | 1 | Will only store the date and time value on the input, this is the default, Expect this default to change to DateTime2 as DateTime is the legacy |
DateTime2 | 2 | DateTime2 provides a much larger Date Range, in addition higher accuracy sorting down to the 100 nanoseconds level. Microsoft recommends datetime2 over datetime for new work.. but it usage is still catching up hence the default is still DateTime. |
SmallDateTime | 3 | Will only store the date and time value on the input, this will be accurate up to the one minute. SmallDateTime is 4 bytes so has big storage advantages over big tables, however it is not SQL ANSI Compliant.. |