NServiceBus.Persistence.Sql icon indicating copy to clipboard operation
NServiceBus.Persistence.Sql copied to clipboard

SQL Dialect: Use `datetime2` instead of `datetime` to save storage

Open ramonsmits opened this issue 1 year ago • 0 comments

Describe the feature.

Current SQL dialect uses datetime while datetime2 is recommended by Microsoft:

Use the time, date, datetime2 and datetimeoffset data types for new work. These types align with the SQL Standard.

The datetime2 type is supported since SQL Server 2008.

For outbox the schema can use DateTime2(0) as the precision is not required and only needed for outbox cleanup. This also saves 2 bytes (8 vs 6 bytes) for each row.

Additional Context

No response

ramonsmits avatar Jun 02 '24 10:06 ramonsmits