serilog-mssql / serilog-sinks-mssqlserver

A Serilog sink that writes events to Microsoft SQL Server and Azure SQL
Apache License 2.0
278 stars 148 forks source link

Is Datetime2(n) supported ? #416

Closed patopat closed 2 years ago

patopat commented 2 years ago

Hi,

I removed the default Timestamp column, and I added a new one with a Datetime2(3) format. Does the Datetime2(n) format is support ?

Best regards, Pat

ckadluba commented 2 years ago

Hi @patopat!

As documented here, the TimeStamp column supports datetime, datetime2 and datetimeoffset.

Best regards, Christian

patopat commented 2 years ago

Hi @ckadluba,

Ok, so only datetime2(7) is supported.

Best regards, Pat

patopat commented 2 years ago

@ckadluba,

Do you plan to support Datetime2(0..7) options ?

Best regards, Pat

ckadluba commented 2 years ago

Not at the moment but we are always happy to have a PR. :)

If this is implemented, the DataLength column option should be used for specifying the n. Just like it is currently used for nvarchar type string columns.