Inserting fractional seconds into datetime2 columns #450
-
Hi there, I'm having issues providing a fractional component to a timestamp when inserting into a column of type datetime2. If I specify fraction as anything other than 0, I get error 22008 (fractional second precision exceeds the scale specified in the parameter binding). Should I be doing something different to insert this kind of data?
`use std::collections::HashMap; use odbc_api::buffers::BufferDesc; fn main() {
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hello @jamesetaylor-tudor , argument is bound with percision 7. This is also the maximum supported precision for datetime2 in an MSSQL Database. The timestamp fraction field is specified in nanoseconds (precision 9). So whatever number you put in there, at least its last two digits shoud end in Best, Markus |
Beta Was this translation helpful? Give feedback.
-
Here is how |
Beta Was this translation helpful? Give feedback.
Hello @jamesetaylor-tudor ,
argument is bound with percision 7. This is also the maximum supported precision for datetime2 in an MSSQL Database. The timestamp fraction field is specified in nanoseconds (precision 9). So whatever number you put in there, at least its last two digits shoud end in
0
. Fraction1
would mean 1 nanosecond and not e.g. one tenth of a second.Best, Markus