Hello,
We have discovered the following: using SNC (SQL Native Client, provider SQLNCLI11 of course), so when a table has datetime column in primary key and database compatibility level is set to, for example, 130 (SQL Server 2016), datawindow based on such table won't update the table, because when I look in SQL Server Profiler I see that datetime2 is used
exec sp_executesql N'UPDATE TIMEREG_SUBTABLE SET CLOCK_STOP = @P1 WHERE CLOCK_ID = @P2 AND CLOCK_ROW = @P3 AND CLOCK_START = @P4 AND CLOCK_STOP = @P5 AND CLOCK_COMMENT IS NULL ',N'@P1 datetime2(7),@P2 int,@P3 int,@P4 datetime2(7),@P5 datetime2(7)','2020-11-16 18:00:00',16164,1,'2020-11-16 16:26:38.7770000','2020-11-16 16:27:26.3500000'
and when data values from string are converted to actual datetime data they don't match, for example '2020-11-16 16:26:38.7770000' is converted to '2020-11-16 16:26:38.7766667'.
There is no such problem of course when compatibility level is 100 (SQL Server 2008), but it is not an option in my case. Is there a way to control this behavior of SNC driver?
PowerBuilder 2017 R3 build 1858.
Thanks,
Aliaksei.
- datawindow is built on table which has datetime column in PK
- this dw updates data just fine when db compatibility level is 100 (SQL2008), but when compatibility level is 130 (SQL2016) update statement produced by dw doesn't update the data, because internally (on SNC driver level I think) there is string-to-datetime2 conversion.
Is there a way to control that?
Thanks,
Aliaksei.