Skip to content

DbUp MS SQL Server schema should use datetime2 instead of datetime #11

Description

@tonihele

DbUp MS SQL Server schema should use datetime2 instead of datetime. This is really a minor issue in a sense. datetime data type is mostly deprecated, datetime2 does the job better. datetime2 offers also increase precision if that is required. But for just in-place replacement datetime2(3) can be used.

datetime does some rounding also so currently the timestamps aren't really accurate to 100 fractional seconds unlike it looks. datetime also takes up 8 bytes of storage, with datetime2(3), only 7 bytes are consumed (with full precision the same though, 8 bytes). These are the notable differences between the two.

I saw you also had discussions changing to datetimeoffset, that would be fine too and make this obsolete.

MS documentation:
https://docs.microsoft.com/en-us/sql/t-sql/data-types/datetime2-transact-sql

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions