Cannot edit row from MS SQL Server which contains DateTime2
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
Sorry I can't reproduce your problem.
I tested on MSSQL version 14.00.3048 and JDBC driver "Microsoft JDBC Driver 7.2 for SQL Server" version 7.2.0.0.
The table I tested with was created as follows:
Thanks for checking into it!
Are you running Compatibility Level 120 or lower? In that case you will not see the fractional milliseconds. Here is a quote from Microsoft:
An example of a breaking change protected by compatibility level is an implicit conversion from datetime to datetime2 data types. Under Database Compatibility Level 130, these show improved accuracy by accounting for the fractional milliseconds, resulting in different converted values. To restore previous conversion behavior, set the Database Compatibility Level to 120 or lower.
I believe we were formerly at compatibility level 90 and are now at 140. When I get to work on Monday I will try your example although it looks accurate and should create the Modify/Edit issue.
Regards,
Jim Thomas
Last edit: Gerd Wagner 2020-05-12
I created the exact same table you have in your email response. I cannot 'Make Editable' and change the DateTime2TestStr without an error.
Regards,
Jim Thomas
Last edit: Gerd Wagner 2020-05-12
I'm sorry, my MSSQL doesn't seem to allow compatibility levels higher than 120.
Here are the statements I used:
Perhaps there is somebody out there who has some Java experience, is able reproduce the problem and could have a look at it?