NServiceBus.Persistence.Sql
NServiceBus.Persistence.Sql copied to clipboard
SQL Dialect: Use `datetime2` instead of `datetime` to save storage
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