I would like to use the new Sql data type datetime2
for event logging (since the standard datetime has lower accuracy than System.DateTime
that, which leads to data loss during storage), but when I generate the code with sqlmetal.exe
, I get the following warning:
db.dbml (98): Warning DBML1008: Mapping between DbType 'DateTime2 (7) NOT NULL' and Type 'System.DateTime' in the 'CreatedOn' column of the Event type can result in data loss when loading from the database.
The warning disappears if I change the definition of the column to datetime2(2)
, but the accuracy of 2 digits is lower than what System.DateTime
can be processed, right? What for? How can I suppress a warning?
source
share