2

I'm seeing something extremely strange.. in SQuirreL I am updating the column of a SQL table to have a ReviewDueDate of '2016-08-15 00:00:00.000' (and also tried cast('2016-08-15' as datetime)). When I query the same row I am seeing a value of [2016-08-13 00:00:00.0]. Yet when I query the same row/object through our WebAPI 2 OData V4 web service I am getting the correct date. Has anyone ever seen the SQuirreL client have such squirrely behavior?

set ReviewDueDate = '2016-08-15 00:00:00.000'--cast('2016-08-15' as datetime)

jKlaus
  • 382
  • 3
  • 8
  • I have never experienced this, but it sounds like your updates are either being cached and not written. – Tim Biegeleisen Aug 01 '16 at 22:11
  • @TimBiegeleisen - Prior to executing that update statement the value was null. – jKlaus Aug 01 '16 at 22:11
  • Have you tried to re-run update request with a different value? – Slava Murygin Aug 01 '16 at 22:55
  • 1
    Time zone settings? – Norbert Aug 01 '16 at 23:30
  • I have tested a few dates.. all of them are returning values 2 days shy of their actual values. Actual values being what I'm setting and what returns from the WS. Tomorrow I'll jump on a server and see what value MSSQL gives me.. I assume my SQuirreL client is just mis-configured. Though since I've never had this happen before it "seems" unlikely. – jKlaus Aug 02 '16 at 00:41
  • Can you run a profiler and see what SQuirreL sends to SQL? – Slava Murygin Aug 02 '16 at 01:02
  • So far it appears that the SQL JDBC driver I currently have is having issues with the column type: DateTime2(7). All of our other DateTime2 implementations are DateTime2(3). The value is being set fine but when the query returns its manipulating the data. I'm going to update my driver and will post my findings. Figure its worth putting it out there in case others run into this issue. – jKlaus Aug 02 '16 at 13:25

1 Answers1

0

So the problem was the driver.. I upgraded to the latest SQL JDBC driver and everything looks good. I assume the issue had to do with the increased decimal length of the DateTime2(7) compared to DateTime / DateTime2(3).

jKlaus
  • 382
  • 3
  • 8